Compare Phone Number(Main.java)

 import java.io.*;


import java.util.Scanner;

class Main{
    public static void main(String[] args) throws Exception{    
        
        
        //Fill your code
        Scanner sc = new Scanner(System.in);    
        System.out.println("Enter Name");
        String a = sc.nextLine();
        System.out.println("Enter UserName");
        String b = sc.nextLine();
        System.out.println("Enter Password");
        String c = sc.nextLine();
        System.out.println("Enter PhoneNumber");
        long d = sc.nextLong();
        User use1 = new User(a, b, c, d);
        
        Scanner it = new Scanner(System.in);    
        System.out.println("Enter Name");
        String e = it.nextLine();
        System.out.println("Enter UserName");
        String f = it.nextLine();
        System.out.println("Enter Password");
        String  g = it.nextLine();
        System.out.println("Enter PhoneNumber");
        long h = it.nextLong();
        User use2 = new User(e, f, g, h);
        boolean ch = use1.comparePhoneNumber(use2);
        if(ch) {
            System.out.println("Same Users");
        }
        else {
            System.out.println("Different Users");
            
        }
        
        
    }
}

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.