Programming in Java
Object Oriented in Java
Advanced topics in Java
Modal Box
Tutorials
C is a very powerful and widely used language. It is used in many scientific programming situations. It forms (or is the basis for) the core of the modern languages Java and C++. It allows you access to the bare bones of your computer.C++ is used for operating systems, games, embedded software, autonomous cars and medical technology, as well as many other applications. Don't forget to visit this section...
super in java
Super keyword is used to call super class constructor or the super class function.
When we use super to call the super class constructor, then it should be the first statement.
class Person { String name=null; int age=0; Person(String n, int a) { name=n; age=a; }
void display() { System.out.println("name=" +name); } }
class Student extends Person {
int rollNo=0; String course=null; Student(String n, int a, String c, int r) { super(n,a); rollNo=r; course=c; } public void display() { super.display(); System.out.println("Course= "+course+"Roll No="+rollNo); } }
class CheckMain {
public static void main(String args[]) {
Person p= new Person("Rahul",25); p.display(); Student s1= new Student("John",20,"BCA",4093); s1.display(); // variable may be passed instead of static value
} }
Video/ C Introduction
Watch video in full size