Java Reflection

Java Reflection

Contents1 Java Reflection2 Java class named Class3 Create objects of the class named Class4 using .class5 Get Interfaces5.1 Example: Get Interfaces6 Get Superclass and Access Modifier6.1 Example: Get Superclass and Access Modifier7 Reflecting Fields, Methods, and Constructors8 Reflection of a Read More …

Java enums

Java enums

Contents1 Java enums2 Example 1: Java Enum3 Example 2: Java Enum with the switch statement4 Enum Class in Java5 Example 3: Java Enum Class6 Methods of Java Enum Class6.1 1. Java Enum ordinal()6.1.1 2. Enum compareTo()6.1.1.1 3. Enum toString()6.1.2 4. Read More …

Java Anonymous Class

Java Anonymous Class

Contents1 Java Anonymous Class2 Example 1: Anonymous Class Extending a Class3 Example 2: Anonymous Class Implementing an Interface4 Advantages of Anonymous Classes Java Anonymous Class Java Anonymous Class: In this tutorial, you will find out about Anonymous classes in Java Read More …

Java Nested and Inner Class

Java Nested and Inner Class

Contents1 Java Nested and Inner Class2 Non-Static Nested Class (Inner Class)2.1 Example 1: Inner class3 Access Members of Outer Class within Inner Class3.1 Example 2: Accessing Members4 Static Nested Class4.1 Example 3: Static Inner Class4.1.1 Example 4: Accessing members of Read More …

Java Polymorphism

Java Polymorphism

Contents1 Java Polymorphism2 Example: Java Polymorphism3 Why Polymorphism?4 Java Method Overriding4.1 Example 1: Polymorphism using method overriding5 2. Java Method Overloading5.1 Example 3: Polymorphism using method overloading6 3. Java Operator Overloading7 Polymorphic Variables7.1 Example: Polymorphic Variables Java Polymorphism In this Read More …