Latest Answer : No it won't work.Only one main methods is allowed ...
Latest Answer : Abstract class can have instance variable, static variable, constructor, abstract methods, concrete methods, instance blocks and static blocks.Subclass has to extend abstract class using extend keyword. ...
Latest Answer : The static variable is used to Synchronize (Ex: in seaphores…) the threads because it maintains the single copy for all the instances. We can call the static variable by the class name or from the reference. It stored in a Data segment. ...
Latest Answer : We need not call the finalize() method directly. The method is called automatically by the garbage collector when it determines no more references to the object exist. But when we need to clean-up non-Java resources ie closing a file, we need ...
Latest Answer : Finally method is executed whether the exception is raised or not and normally used to close the resource that are opened in the before. ...
Latest Answer : Its a common mistake to assume that overloading is a kind of polymorphism in OOPS..But its actually not..However the definition is the same.. an entity existing in different forms is called polymorphism..in Java, polymorphism is achieved with super class ...
Latest Answer : Method Overriding means methods having the same method name,same number of arguements or same type of arguements.Here we use super() method to pass the arguements to the methods in the baseclass. ...
Latest Answer : method represents the behaviour of an object ...
Latest Answer : Please Check with this example programpublic class StaticExam { static int a=10;public static void main(String args[]){System.out.println(" Welcome to static variable testing");StaticExam s= new StaticExam();s.display();}public void display(){System.out.println(" ...
Latest Answer : Interface is used to define set of rules. Interface is a collectionof empty methods. It is solely used as a base class. Class which implents an interface need to provide the implemenation of the methods in the interface. ...