Practical 22


Aim:- Write a program to implement Overriding in java.

JAVA Code :-

import java.lang.*;
class A {
  void display(){
    System.out.println("In parent class ");
  }
}
class B extends A {
  void display() {
    System.out.println("In chlid class ");
  }
}
class overriding {
  public static void main(String args[]) {
     B obj =new B();
     obj.display();
  }
}

Output:-



No comments:

Post a Comment

Programs

Home Aim:- Write a program to convert rupees to dollar. (60rupees=1 dollar). Aim:- Write a program that calculate percentage marks...