Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

super class tostring java

   public String toString() {
        return super.toString() + ", isProfessional=" + isProfessional;
    }
Comment

super class java

/* 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 :: multiple inheritance in java 
Java :: java convert char to charsequence 
Java :: java float data type 
Java :: islowercase java 
Java :: Passing data from an activity to a fragment 
Java :: positive numbers in array 
Java :: android studio convert java to kotlin 
Java :: hashmap java 
Java :: menu alert dialog in android 
Java :: spring swagger ui login oauth2 
Java :: using super in java 
Java :: singleton 
Java :: array buffer 
Java :: generics in java 
Java :: check if object is empty java 8 
Java :: junit dependency 
Java :: Java Access LinkedList elements 
Java :: java textwatcher 
Java :: Multi basic auth with spring security 
Java :: java disable stack trace 
Java :: generate random color java 
Java :: strictfp java example 
Java :: input method manager hide keyboard 
Java :: layout focus from recycleview not from top in fragment inside nestedScrollview in android xml 
Java :: Get generic type of class at runtime 
Java :: sum of number from list 
Java :: java write number with variable decimal 
Java :: ExpandableLayout in android 
Java :: oxygen cylinder management program in java 
Java :: processing java screen wrap 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =