Java Drill – 2

1.Can a private method of a superclass be declared within a subclass?
2.Why Java does not support multiple inheritence ?
3.What is the difference between final, finally and finalize?
4.Where and how can you use a private constructor.
5.In System.out.println(),what is System,out and println,pls explain?
6.What is meant by “Abstract Interface”?
7.Can you make an instance of an abstract class? For example – java.util.Calender is an abstract class with a method getInstance() which returns an instance of the Calender class.
8.What is the output of x<y? a:b = p*q when x=1,y=2,p=3,q=4?
9.Why Java does not support pointers?
10.Parsers? DOM vs SAX parser
11.What is the main difference between Java platform and other platforms?
12.What is the Java Virtual Machine?
13.What is the Java API?
14.What is the package?
15.What is native code?
16.Is Java code slower than native code?
17.What is the serialization?
18.How to make a class or a bean serializable?
19.How many methods in the Serializable interface?
20.How many methods in the Externalizable interface?
21.What is the difference between Serializalble and Externalizable interface?
22.What is a transient variable?
23.What is synchronization and why is it important?
24.What are synchronized methods and synchronized statements?
25.What are three ways in which a thread can enter the waiting state?
26.Can a lock be acquired on a class?
27.What is thread?
28.What is multithreading?
29.How does multithreading take place on a computer with a single CPU?
30.What is the purpose of the wait(), notify(), and notifyAll() methods?
31.What are the high-level thread states?
32.What is the Collections API?
33.How does Java handle integer overflows and underflows?
34.What is the Vector class?
35.If a method is declared as protected, where may the method be accessed?
36.What is an Iterator interface?
37.What is the difference between yielding and sleeping?
38. Is sizeof a keyword?
39.What are wrapped classes?
40.What is the difference between preemptive scheduling and time slicing?
41.How can you write a loop indefinitely?
42.Can an anonymous class be declared as implementing an interface and extending a class?
43.Which class is the superclass for every class.
44. What is the difference between the Boolean & operator and the && operator?
45.What is the GregorianCalendar class?
46.What is the SimpleTimeZone class?
47.What is the Properties class?
48.What is the purpose of the Runtime class?
49.What is the purpose of the System class?
50.What is the purpose of the finally clause of a try-catch-finally statement?
51.What must a class do to implement an interface?
52.What is a static method?
53.What is the difference between a static and a non-static inner class?
54.What is an object’s lock and which object’s have locks?
55.When can an object reference be cast to an interface reference?
56.What’s the difference between J2SDK 1.5 and J2SDK 5.0?
57.Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?
58.Can an inner class declared inside of a method access local variables of this method?
59.What can go wrong if you replace && with & in the following code:
String a=null; if (a!=null && a.length()>10) {…}
60.What’s the main difference between a Vector and an ArrayList
61.When should the method invokeLater()be used?
62.How can a subclass call a method or a constructor defined in a superclass?
63.What’s the difference between a queue and a stack?
64.You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?
65.What comes to mind when someone mentions a shallow copy in Java?
66.What comes to mind when you hear about a young generation in Java?
67.You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use:
ArrayList or LinkedList?
68.How would you make a copy of an entire Java object with its state?
69.There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it?
70.How can you minimize the need of garbage collection and make the memory use more effective?
71.What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access it?
72.How do I deserilaize an Object?
73.What are different types of inner classes ?
74.Difference Between String and String Buffer?
75.difference between verses (==) and .equals().

No comments:

Post a Comment