1. A method can be defined both private an final the compiler will not throw error. Declaring a method both final and private is redundant since private methods by default cannot be overridden.
2. What happen if you declare a static method as final
Ans : Stops you from declaring a static method with the same name and parameter types in a derived class
3. "this" keyword cannot be used inside static methods/blocks
4. Static final variables will have to be initialized with the declaration and cannot be left blank
5. final variables can initialized only during declaration or in the consturctor
6. Anonymous classes do not have constructors
7. few methods in Object class are-
clone, equals,hashcode,finalize,toString, notify,notifyall,wait
8. how to call garbage collector explicitly
System.gc();
9.Difference btw Interface & Abstract
all methods in the Interface and implicitly abstract
10. How to create a deamon thread
setDeamon()
Sythetic Field
http://tns-www.lcs.mit.edu/manuals/java-api-1.1beta2/guide/innerclasses/html/innerclasses.doc.html#19265
2. What happen if you declare a static method as final
Ans : Stops you from declaring a static method with the same name and parameter types in a derived class
3. "this" keyword cannot be used inside static methods/blocks
4. Static final variables will have to be initialized with the declaration and cannot be left blank
5. final variables can initialized only during declaration or in the consturctor
6. Anonymous classes do not have constructors
7. few methods in Object class are-
clone, equals,hashcode,finalize,toString, notify,notifyall,wait
8. how to call garbage collector explicitly
System.gc();
9.Difference btw Interface & Abstract
all methods in the Interface and implicitly abstract
10. How to create a deamon thread
setDeamon()
Sythetic Field
http://tns-www.lcs.mit.edu/manuals/java-api-1.1beta2/guide/innerclasses/html/innerclasses.doc.html#19265
No comments:
Post a Comment