Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java constructor chaining

class Base {
  
    int number;
 
    // Constructure of Base class
    Base(int number) {
      
        this.number = number;
    }
}
 
class Derived extends Base {

    // Constructure of Derived class
    Derived(int number) {
      
    	// calls constructure of Base class
        super(number);
    }
 
    public static void main(String args[]) {
      
        // calls constructure of Derived class
        Derived obj = new Derived(99);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java stack methods 
Java :: abs in java 
Java :: javac celar 
Java :: android:windowLightStatusBar programmatically 
Java :: java base64 
Java :: intellisense for eclipse java 
Java :: how to create an array list in java 
Java :: java timer 
Java :: java check palindrome with string builder 
Java :: test a javafx project 
Java :: java interface attributes 
Java :: this in java 
Java :: parameterized constructor 
Java :: Java push() Method 
Java :: java print type of variable 
Java :: string length in android studio java 
Java :: java printf 
Java :: setupactionbarwithnavcontroller problem 
Java :: arraylist add new element to end 
Java :: java standard exceptions 
Java :: java what is at 
Java :: how to add a list in a list java 
Java :: jtable font size 
Java :: android java back button closeapp 
Java :: arraylist to linkedlist java 
Java :: rock paper scissor in java 
Java :: uses or overrides a deprecated API. 
Java :: Convert Strings To Mathematical Expressions In java 
Java :: java php object 
Java :: Create class from string variable JAVA 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =