Ramirez_RD

Samson_Info

Feb 11th, 2025
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.57 KB | None | 0 0
  1. package samson_angel;
  2. import java.util.*;
  3. public class Samson_Angel {
  4.     private int ID;
  5.     private String name = "";
  6.     private int age;
  7.     private String address = "";
  8.    
  9.     public int getUniqueID(){
  10.         return ID;
  11.     }
  12.     public void setID(int newID){
  13.         this.ID = newID;
  14.     }
  15.     public String getName(){
  16.         return name;
  17.     }
  18.     public void setName(String newName){
  19.         this.name = newName;
  20.     }
  21.     public int getAge(){
  22.         return age;
  23.     }
  24.     public void setAge(int newAge){
  25.         this.age = newAge;
  26.     }
  27.     public String getAddress(){
  28.         return address;
  29.     }
  30.     public void setAddress(String newAddress){
  31.         this.address = newAddress;
  32.     }
  33.     static void Info(){
  34.         Samson_Angel Person = new Samson_Angel();
  35.         Scanner sc = new Scanner(System.in);
  36.         System.out.println("Person Information Sheet");
  37.         System.out.print("Enter your ID: ");
  38.         Person.setID(sc.nextInt());sc.nextLine();
  39.         System.out.print("Enter your Name: ");
  40.         Person.setName(sc.nextLine());
  41.         System.out.print("Enter your Age: ");
  42.         Person.setAge(sc.nextInt());sc.nextLine();
  43.         System.out.print("Enter your Address: ");
  44.         Person.setAddress(sc.nextLine());
  45.         System.out.println("ID: " + Person.getUniqueID());
  46.         System.out.println("Name: " + Person.getName());
  47.         System.out.println("Age: " + Person.getAge());
  48.         System.out.println("Address: " + Person.getAddress());
  49.     }
  50.     public static void main(String[] args){
  51.         Info();
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment