# Java program to print student details using "single-level" inheritance In this section, You will learn how to print student details using single inheritance in java, with Scanner and without Scanner class. 1.) With " Scanner " class Let's try to create a simple example : ➤ Example : student.java; import java.util.Scanner; class StudentDetails { int roll_no ; String name , cl ; //creating a function to take student details void input () { Scanner sc = new Scanner ( System . in ); System . out . print ( "Ente
Comments