सीधे मुख्य सामग्री पर जाएं

#52 What is Simple Inheritance or Single Inheritance in Java | Simple / Single Inheritance क्या है

package com.sudhirtheindian2.java123;



// class student{ // super class
// int rollNo,marks;
// String name, college;
//
// void input(){
// System.out.println("enter the detail of student");
// }
//
//
//
// }
// class sudhir extends student{ // sub class
//
// void display(){
// rollNo =1;
// marks=40;
// name ="sudhir";
// college = "IIT";
// System.out.println(rollNo+" "+name+" "+marks+" "+college);
//
//
// }
//
// }

//public class Simple {
// public static void main(String[] args) {
// sudhir s = new sudhir();
// s.input();
// s.display();
//
//
//
//
// // Simple or Single Inheritance
//
// What is simple / single inheritance in java ?

// Simple inheritance contain only one super class and
// one sub class is called simple inheritance

// super----> sub

// one super class & one sub class


////syntax
//class Super{
//
//
//}
//
//class Sub extends Super{
//
//}


// }
//}

टिप्पणियाँ

इस ब्लॉग से लोकप्रिय पोस्ट