Category: J2SE Category
Name any four methods every Java class will have
Class Object is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class. protected Object clone(): Creates and returns a copy...
What are abstract classes, abstract methods?
A class or a method qualified with “abstract” keyword is an abstract class or abstract method. You create an abstract class when you want to manipulate a set of classes through a common interface....
What’s the difference between the == operator and the equals() method? What test does Object.equals()
equals methods checks for the content of the string objects while == checks for the fact that the two String objects point to same memory location ie they are same references. This methods belongs...
Does Java have destructors?
Java does not have destructors; but it has finalizers that does a similar job. Garbage collector does the job working in the background Here is the syntax public void finalize(){ } if an object...
Recursive Methods
Recursive Methods What is Recursive Function? A recursive function is a function that calls itself during its execution. This enables the function to repeat itself several times, outputting the result and the end of...
Overloading Vs Overriding
Overloading vs Overriding A Way of Implementing Polymorphism Overloading Overloading refers to having more than one method with the same name in a class whereas overriding refers to redefining methods of the superclass in...
Java Serialization Vs De-Serialization
Java Serialization Vs De-Serialization The capability of an object to exist beyond the execution of the program that created it is known as persistence To make the file object persistent, the file object has...
What is Serialization and deserialization?
Java Serialization Vs De-Serialization The capability of an object to exist beyond the execution of the program that created it is known as persistence To make the file object persistent, the file object has...
Java Call By Value and Call By Reference
Java Call By Value and Call By Reference Pass by value in java means passing a copy of the value to be passed. Pass by reference in java means the passing the address itself....
Recent Comments