• Packages with inheritance

    In this blog, we will see how to customize our inheritance example in different packages.   In this example, we will see three different packages pack1, package1 and package2. Package1 with A class Package2 with B Class Pack1 with example2 Class   package package1; public class A {             public void methodA()             {                         […]

  • Simple example on Package Java Program

    What is Package in Java Program? – In Simple word, package are folder or directory. What is use of packages in Java Program? – When we want to store our classes in proper folder that time we need packages. Example: I give simple project details with packages storage. Project: College Management Student Packages – Store […]

  • Abstract Class in java Program

    Abstract class and methods is many time uses in java programs when we want to create indexing of our methods in some secure class. Why Abstract class is secure? – We can’t create an object of Abstract Class, so we have to inheritance abstract with sub class. So, all access of abstract classes is managed […]

  • Remove Override Solution – 4: Dynamic Method Dispatch

    Dynamic method dispatch is 4th solution of remove override methods from java programs. In this blog we will see how to stop override method using dynamic method dispatch.   Example on Dynamic Method Dispatch class A {                 void method()                 {                                 System.out.println(“Welcome in A”);                 } }              class B extends A {                 […]

  • Final keyword with Class and Variable

    In this blog, we will work on final keyword with class and variable. Final class can’t inheritance with other class and final variable can’t modify after assign value. Let’s see both example in one blog   Final keyword with Class final class A {                 // Create some method } class B extends A             // […]