Inheritance

Property of parent class access in child classin inheritance

Child class access parent class property by using extends keyword

Types of inheritance

1)Single inhritance
2)Multilevel inheritance
3)Hybrid inheritance
4)Multipleinheritance

Taking value from user

import java.util.*;

class demo{

  public static void main(String args[]){
     Scanner s=new Scanner(System.in);
	 System.out.println("Enter your name");
	 String name=s.nextLine();
	 System.out.println("so name is :"name);
	 
	  System.out.println("Enter your number");
	 int num=s.nextInt();
	 System.out.println("so value is:"+num);
	 }
	 }  
       

output:	
Enter your name:
so name is: javaonexperiance.com
Javaonexperiance.com
Enter your number:
123
So value is : 123

          

Address

Plot number-56/1
Near Gurudwara
LandMark :
Opposite A.N.D college
Govindpuri Metro station
New Delhi
Mobile number:
8826034620