A very simple program to demonstrate the use of Super keyword in Java.
I am currently accepting programming, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.
My mobile number here in the Philippines is 09173084360.
I am currently accepting programming, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Program Listing
SuperDemo.java
package oop_java;
/**
* NetBeans IDE 8.2
* @author Mr. Jake R. Pomperada
* March 30, 2018 Friday
* Bacolod City, Negros Occidental
*/
class Super_class{
int test( int num ) {
return num;
}
}
class Sub_class extends Super_class{
int test( int num ) {
return 300 + num;
}
}
public class SuperDemo {
public static void main (String args[ ]){
Sub_class obj=new Sub_class( );
System.out.println("Super Keyword in Java Demonstration");
System.out.println("\n");
System.out.print("The result is " + obj.test( 200 ));
System.out.println("\n");
}
}