-
String b=new String("A");
String c="A";
String d="A";
Then which of the following returns true?
1. if(a==b)
2. if(b==c)
3. if(c==d)
4. if(d==a)">String a=new String("A");String b=new String("A");String c="A";String d="A";Then which of the following returns true?1. if(a==b)2. if(b==c)3. if(c==d)4. if(d==a)
-
-
-
-
-
We know that when execution of java starts, 1 st public static void main(String args[]) methodis execute. so i have ask you that ,when main method is executed, it s static method. so at the time of execution of main method, object is not their. after that code under main method is run which contain object of classes.so Q. when main method is executed,at that time object is not in memory so at that time can i say that JAVA IS NOT OBJECT-ORIENTED???
ACCORDING TO ME yes,after main methode,code run which will create object after main method, java is OBJECT ORIENTED.
-
-
Primitive Types
What happens when you add a primitive type (e.g. double) value to a collection?
-
What is the preferred size of a component
The preferred size of a component is the minimum component size that will allow thecomponent to display normally.
-
What method is used to specify a container's layout
The setLayout() method is used to specify a container's layout.
-
What state does a thread enter when it terminates its processing
When a thread terminates its processing, it enters the dead state.
-
What is the Collections API
The Collections API is a set of classes and interfaces that support operations oncollections of objects.
-
What is the Vector class
The Vector class provides the capability to implement a growable array of objects
-
25. Is sizeof a keyword
The sizeof operator is not a keyword.
-
Can an object's finalize() method be invoked while it is reachable
An object's finalize() method cannot be invoked by the garbage collector while the objectis still reachable. However, an object's finalize() method may be invoked by otherobjects.
-
What class is the top of the AWT event hierarchy
The java.awt.AWTEvent class is the highest-level class in the AWT event-classhierarchy.
-
When a thread is created and started, what is its initial state
A thread is in the ready state after it has been created and started.
-
What is the argument type of a program's main() method
A program's main() method takes an argument of the String[] type.
-
What is the purpose of the wait(), notify(), and notifyAll() methods
The wait(),notify(), and notifyAll() methods are used to provide an efficient way forthreads to wait for a shared resource. When a thread executes an object's wait() method, itenters the waiting state. It only enters the ready state after another thread invokes theobject's notify() or notifyAll() methods..
-
What modifiers may be used with an interface declaration
An interface may be declared as public or abstract.
Java Interview Questions
Ans