single inheritance


Program which will accept name,age,height and weight from the user . It shows the output Test Case 1 Input (stdin) Hari 20 5.2 50 Expected Output Name:Hari Age:20 Height:5.2 Weight:50 Test Case 2 Input (stdin) Jai 21 5.5 45 Expected Output Name:Jai Age:21 Height:5.5 Weight:45

Program :

import java.util.*;

public class TestClass {

 public static void main(String[] args) {

       y sha=new y();







       class x{

         Scanner in=new Scanner(;



      String  a=in.nextLine();

       int b=in.nextInt();

       double c=in.nextDouble();

      int d=in.nextInt();


       class y extends x{

         void display()