QN033. Write a class to accept and print personal information.
1. Objective
To accept and print personal information.
2. Theory
In this program, we create class to accept and print the personal information and display.
3. Source Code
      import java.util.Scanner; 
      public class Qn033{
        public static void main(String[] args){
          Scanner input = new Scanner(System.in);
          String name, address,email;
          Long phoneNo;
          System.out.println("Enter your Details");
          System.out.print("What is your name? ");
          name = input.nextLine();
          
          System.out.print("Enter your full address: ");
          address = input.nextLine();
          
          System.out.print("Enter your email: ");
            email = input.nextLine();
          
          System.out.print("Enter your phone Number: ");
          phoneNo = input.nextLong();
          
    
          System.out.println("\n\nYour Personal Details");
          System.out.println("Name: " + name);
          System.out.println("Address: " + address);
          System.out.println("Phone Number: " + phoneNo);
          System.out.println("Email: " + email);
        }
      }
    
    4. Output
    Enter your Details 
    What is your name? Sajan Kc 
    Enter your full address: Budhanilkantha-13, Kathmandu 
    Enter your email: sazankce@gmail.com 
 
    Enter your phone Number: 9843337779 
    
    Your Personal Details 
    Name: Sajan Kc 
    Address: Budhanilkantha-13, kathmandu 
    Phone Number: 9843337779 
    Email: sazankce@gmail.com 
    
5. Conclusion
In this way, I would like to conclude that, by using this program we can accept the personal details and display them.