- Home
- Interview Questions
- Java
As we know, a method usually invokes another method. A method can also invoke itself. Such a method is known as recursive method.
A local class is declared locally within a block of Java code rather than as a member of a class Only classes may be defined locally: interfaces, enumerated types, and annotation types must be top-level or static member types. Typically, a local class is defined within a method, but it can also be defined within a static initializer or instance initializer of a class.
A class for which we cannot create objects is called an abstract class. A abstract class is to be extended and then instantiated.
Some of the methods in an abstract class may be declared as abstract methods. Such an abstract method consists of a declaration without any body, as shown below:
abstract class test11 { abstract int numtest(); }All abstract methods that are declared in an abstract class should be implemented by the class that extends this abstract class. Other wise that subclass itself should be declared as abstract.
A static variable is associated with the whole class instead of a specific instances of a class. But a Nonstatic variables take on unique values with each object instance.
Swing components are divided into three categories .There are Container components, Ordinary components, Menu components.