Implement the concept of inheritance with example.
class Student{
void Student_Details() {
System.out.println("Student Details...");
}
}
class Marks extends Student {
void Marks_Details() {
System.out.println("Student Marks ...");
}
}
public class Main {
public static void main(String args[]) {
Marks s = new Marks ();
s.Student_Details();
s.Marks_Details();
}
}
Comments
Leave a comment