Vikhyath_11

2

Jul 28th, 2024
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. package balance;
  2. import java.util.*;
  3.  
  4. public class Account {
  5.  
  6. long acc,amount;
  7. String name;
  8.  
  9. public void fetch(){
  10. Scanner sc = new Scanner(System.in);
  11. System.out.println("Enter Account Number");
  12. acc=sc.nextLong();
  13. System.out.println("Enter Account Name");
  14. name=sc.next();
  15. System.out.println("Enter Amount");
  16. amount=sc.nextLong();
  17. }
  18. public void display(){
  19. System.out.println("Account Number : "+acc);
  20. System.out.println("Account Name : "+name);
  21. System.out.println("Amount : "+amount);
  22. }
  23. }
  24.  
  25.  
  26. public class Bank{
  27. public static void main(String[] args) {
  28. Account one = new Account();
  29. one.fetch();
  30. one.display();
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment