Anonymous inner class is a type of inner class which is declared without a name. Basic Syntax for Anonymous Inner Class: /* Give importance to the beginning curly braces & there is a fact that the semicolon at the end is also important, While creating an anonymous class:*/ AnonymousInnerClass karthikh= new AnonymousInnerClass () { // […]
What is Anonymous Inner Class?
An Anonymous inner class is declared by without name and the syntax of an anonymous inner class is also different from other inner classes. Many Java developers believe that anonymous inner classes increase the complexity of the code. But they are extremely helpful in defining the subclass. It is easy to define callbacks using anonymous […]
What is Diamond Problem?
The diamond problem in object oriented programming can be defined as an enigma which aroused as a result of multiple inheritance. Object oriented programs like C++ allow multiple inheritance in state which will result in diamond problem. Java does not allow multiple inheritance for classes but it is enabled to interfaces. What is Diamond Problem? […]
What is Final Modifier?
Final modifier in Java is used to indicate a method cannot be overridden in a derived class. When final modifier is declared it prevents the class from acting as a base class and stops the derived class. This process will prevent late binding which in turn stops polymorphism. Final modifiers will always precede the statement […]
How Copy Constructor work?
Unlike C++, in Java programming copy constructors are not created by default. The programmer has to code the copy constructor separately in java. Java copy constructor accepts only one argument and this argument must belong to the same type of the constructor. Copy constructor is method where an instance of a class is taken and […]
What is Finally Block?
Finally block in Java is used to execute the important codes such as stream and closing connection. Even if you don’t handle the exception java finally block will always be executed. Every finally block must be followed by run or catch block. A finally statement is always associated with try statement. Finally block identifies the […]
What is Java bytecode? Is it platform independent?
What is JVM? Java Virtual Machine is a machine language architecture developed by the Sun Micro systems to compile the programs written using Java. JVM is introduced as a cross-platform computing program. There are several components used in JVM: Stack: It is the storage area for methods and variables. It can be changed according to […]
- « Previous Page
- 1
- …
- 8
- 9
- 10
- 11
- 12
- 13
- Next Page »