The main reason behind the use of inner class is to group the classes with particular logic. This process of grouping classes is called as encapsulation. Increased use of encapsulation in a program will make the code more readable. Why the Use of Inner Class is Necessary in Java? Consider you are using a chat […]
Does Java Pass by Value or Pass by Reference?
Creating copies of values inside the variables and passing the method as arguments is called as “passing by value”. In “pass by value” the actual variable will not be passed. In Java, all arrays, primitive and class types are passed by value. “Pass by reference” is not used in Java. Consider the following code as […]
What is Method Overloading?
If the method present in subclass is similar to the method present in parent class, it is called as method overriding in Java. Method overriding is based on the polymorphism concept of object oriented programming. Method overriding allows the developer to create two methods with same and interface. Method overriding allows the programmer to write […]
What is Java Reflection?
The process of inspecting and changing the runtime behaviour of class during runtime is called as “Java Reflection”. The concept of Java reflection is often confused with the concept of introspection. Introspection can only examine the types and properties of an object during runtime. Java reflection can examine and modify the object during runtime. The […]
What is Inner Class?
Inner classes are the classes which are defined inside a class or interface. Basic Syntax for Inner Class in Java is class OutrClass { class InnrClass { Text goes here… } } If the inner class is compiled using the command javac OutrClass.java. We will get two class files instead of one. OutrClass.class and OutrClass$InnrClass.class […]
What is Downcasting in Java?
The process of typecasting the object of base class type into derived class type is called as downcasting in Java. The process of Java downcasting is simple. All you have to do is to derive a class from base class by direct or indirect process. An object from base class type is automatically typecasted into […]
Types of Binding in Java
The process of connecting a method definition to a method call is called binding. Binding processes are classified into two types namely: Static Binding Dynamic Binding Static Binding Static Binding is also known as Early Binding. If a compiler can resolve the binding process during compile time it is called as static binding. Instance methods […]
- 1
- 2
- 3
- …
- 7
- Next Page »