TechFundu

  • Increase font size
  • Default font size
  • Decrease font size
Welcome Guest,  Login | Join Now
Home Read Articles Java Technologies


What is the difference between NoClassDefFoundError and ClassNotFoundException?

(2 votes, average 4.50 out of 5)
These two are very common exception/error that Java programmers see in their day to day work so it will be really helpful to troubleshoot our programs if we could understand the differences between these two classes.

This is what sun's java docs says about these two classes:

java.lang.ClassNotFoundException is thrown when an application tries to load in a class through its string name using:The forName method in class Class.The findSystemClass method in class ClassLoader .The loadClass...

Last Updated on Monday, 04 January 2010 09:02
 

Java 1.5 Interview Questions

Q1. How could Java classes direct program messages to the system console, but error messages, say to a file?
A. The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed:
Stream st = new Stream(new FileOutputStream(”output.txt”));
System.setErr(st); System.setOut(st);

Q2. What’s the difference between an...

Last Updated on Thursday, 27 August 2009 12:06
 

Java Interview Questions

(2 votes, average 3.00 out of 5)
Is “abc” a primitive value? – The String literal “abc” is not a primitive value. It is a String object.What restrictions are placed on the values of each case of a switch statement? – During compilation, the values of each case of a switch statement must evaluate to a value that can be promoted to an int value.

 What modifiers may be used with an interface declaration? – An interface may be declared as public or abstract.Is a class a subclass of itself? – A class is a subclass...

Last Updated on Monday, 10 August 2009 18:37
 

JMS Interview Questions

(1 vote, average 4.00 out of 5)
What are the types of messaging? – There are two kinds of Messaging. Synchronous messaging involves a client that waits for the server to respond to a message. Asynchronous messaging involves a client that does not wait for a message from the server. An event is used to trigger a message from a server.What is publish/subscribe messaging? – With publish/subscribe message passing the sending application/client establishes a named topic in the JMS broker/server and publishes messages to this...

Last Updated on Friday, 14 August 2009 02:52
 


Page 3 of 5

Follow us on Twitter