Explain polymorphism citing an example.
What are instance variables?
What are three advantages of using functions?
What are the rules for naming an array?
When is finally block not called?
What will happen inside init() in servlet. my interviewer asked servlet lifecycle. i said "once servlet is loaded in to memory init() will be called which performs servlet initialization " . Again interview asked what values will be initialized . what is difference between init() and init(ServletConfig config).
2 Answers Infinite Computer Solutions, TCS,
Can we declare the main method of our class as private?
how come we know the object is no more used in the class?
Difference between method overloading and overriding.
Can we use synchronized block for primitives?
what value will be return by the read() method once it reaches the end-of-file? a. Throws EOException b. Return null c. Return -1 d. Read method return nothing, because it is void method
What is return type in java?
Explain the purpose of garbage collection in Java?