Why is the main method static
So that it can be invoked without creating an instance of that class
What is the difference between class variable, member variable and automatic(local) variable
class variable is a static variable and does not belong to instance of class but rather shared across all the instances
member variable belongs to a particular instance of class and can be called from any method of the class
automatic or local variable is created on entry to a method and has only method scope
When are static and non static variables of the class initialized
The static variables are initialized when the class is loadedNon static variables are initialized just before the constructor is called
When are automatic variable initialized
Automatic variable have to be initialized explicitly
What is a modulo operator %
This operator gives the value which is related to the remainder of a divisione.g x=7%4 gives remainder 3 as an answer
How is an argument passed in java, by copy or by reference
What is a modulo operator %
This operator gives the value which is related to the remainder of a divisione.g x=7%4 gives remainder 3 as an answer
What is garbage collection
The runtime system keeps track of the memory that is allocated and is able to determine whether that memory is still useable. This work is usually done in background by a low-priority thread that is referred to as garbage collector. When the gc finds memory that is no longer accessible from any live thread it takes steps to release it back to the heap for reuse
Source:
http://www.j2eebrain.com/java-J2ee-category/interview-questions-faqs/core-java-q
So that it can be invoked without creating an instance of that class
What is the difference between class variable, member variable and automatic(local) variable
class variable is a static variable and does not belong to instance of class but rather shared across all the instances
member variable belongs to a particular instance of class and can be called from any method of the class
automatic or local variable is created on entry to a method and has only method scope
When are static and non static variables of the class initialized
The static variables are initialized when the class is loadedNon static variables are initialized just before the constructor is called
When are automatic variable initialized
Automatic variable have to be initialized explicitly
What is a modulo operator %
This operator gives the value which is related to the remainder of a divisione.g x=7%4 gives remainder 3 as an answer
How is an argument passed in java, by copy or by reference
What is a modulo operator %
This operator gives the value which is related to the remainder of a divisione.g x=7%4 gives remainder 3 as an answer
What is garbage collection
The runtime system keeps track of the memory that is allocated and is able to determine whether that memory is still useable. This work is usually done in background by a low-priority thread that is referred to as garbage collector. When the gc finds memory that is no longer accessible from any live thread it takes steps to release it back to the heap for reuse
Source:
http://www.j2eebrain.com/java-J2ee-category/interview-questions-faqs/core-java-q
Search News
News Categories
What's the News?
Post a link to something interesting from another site, or submit your own original writing for the Java community to read.
Most Popular News
-
How to stand out from other Java/JEE Professionals?
Published about 14-01-2009 | Rated +3 -
10 reasons IT certification will be important in 2009
Published about 05-01-2009 | Rated +2 -
The 9 hottest skills for `09
Published about 02-01-2009 | Rated +1 -
New Features in Servlets 3.0
Published about 05-01-2009 | Rated +4
Most Recent User Submitted News
- What is XPath?
Published about 07-05-2009 | Rated +1 - JSP Interview Questions
Published about 12-09-2009 | Rated 0 - Java EE 5.0 Development with NetBeans 6.0 (Developing Web Applications using JSF)
Published about 24-11-2009 | Rated 0 - New Features in Java EE 6.0
Submitted by Krishna | Rated +1








