What is need of polymorphism in Java? What could have happen if polymorphism is not present?
Latest Answer: Polymorphism enables the method overloading property of Java through which you can overload a method with the same name but with the different number of parameters or types(data types) of parameter.One more thing only return type alone is not efficient ...
Can we make use of "this" keyword reference inside a abstract method or abstract class? Explain
Latest Answer: Yes that is true that we cannot create object of an abstract class. But the question is "Can we use this keyword in an abstract class."The answer is YES we can..Have a look at the following code/* * To change this template, choose Tools ...
Which is faster at class loading - interface or abstract class? Why?
Latest Answer: In both cases differences will be negligible. It only depends upon our designing to use which one. ...
If Exception occurs in finalize() what happened to garbage collector? It will run or not? Explain
Latest Answer: If a finalize method throws any exception, then the execution of the finalize method is halted and the object remains eligible for garbage collection. This doesn't mean that it will never be garbage collected. Whenever garbage collection runs again, ...
Explain the use of serialization process in real time projects?
Latest Answer: Serialization is writing the state of the object to a byte stream. This is useful when you want to save the state of the object in a persistent  storage such as file. ...
class A{ public static void main(String[] a){ System.out.print(String.valueOf(1)+String.valueOf(2)); String s1="s1"; String s2=s1.toString();
Latest Answer: As we have two println statements, so the output would be printed as follows:12,true ...
When there is no methods in the marker interface, then what is the use of marker interface. What is the functionality of the interface. Why do we need to implement marker interface?
Latest Answer: Marker interface do not have any method. It is used only to inform JVM that such class can do some special function like clone, serialize. ...
What are all the methods used for Inter Thread communication and what is the class in which these methods are defined?
Latest Answer: Three methods are used. They are1. wait() - makes one thread wait for some time till another thread is being executed2. notify() - makes one wait process into ready state process3. notifyall() - makes all the waiting processes into ready ...
In how many ways we can create an object? Explain with example.
Latest Answer: There are 5 ways:1-> new operaotor2-> Class.forName()3-> Cloning4-> Deserialization5-> Class.newInstance() ...
What is the meaning of supplying string[] args to main method?
Latest Answer: public static void main(String args[]) This array of Strings is the mechanism through which the runtime system passes information to your application. Each String in the array is called a command line argument. Command line arguments let users affect ...
View page [1] 2 3 4 5 6 7 8 9 10 Next >>

Go Top