Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

super

/* Base class vehicle */
class Vehicle
{
    int maxSpeed = 120;
}
  
/* sub class Car extending vehicle */
class Car extends Vehicle
{
    int maxSpeed = 180;
  
    void display()
    {
        /* print maxSpeed of base class (vehicle) */
        System.out.println("Maximum Speed: " + super.maxSpeed);
    }
}
  
/* Driver program to test */
class Test
{
    public static void main(String[] args)
    {
        Car small = new Car();
        small.display();
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to create microservices architecture with spring boot 
Java :: java string class 
Java :: junit dependency 
Java :: vim yank to clipboard 
Java :: how to sort linked list in java 
Java :: " meaning in java 
Java :: String to java.sql.Date 
Java :: Java try...finally block 
Java :: how to Compile the source code in ./src folder with libraries in ./lib folder using JavaSE-1.7 
Java :: kingkaihockey 
Java :: JAVA Declaration Statements 
Java :: @embeddedid 
Java :: and two editText fields in android studio 
Java :: rotate vector 3d java 
Java :: strictfp java example 
Java :: MOST COMPLEX NAME OF CONSUMER 
Java :: expression régulière seulement un espace java 
Java :: arraylist to java 
Java :: Using Looping Construct to Copy Arrays Java 
Java :: Get Subarray from Array 
Java :: action listener for button to close window java 
Java :: about action Listioner in java Swing 
Java :: Iterating & Adding to a Stack 
Java :: change order of words in string java 
Java :: jbutton scroll list full width size 
Java :: dialog background dimming in android 
Java :: 8233*4 
Java :: convert text type to int java 
Java :: why fields should be final in immutable class? 
Java :: java find nth largest element using priority queue heap 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =