Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- Account account1 = new Account();
- account1.number = 1;
- account1.name = "Alice";
- account1.address = "New York";
- account1.view();
- Account account2 = new Account();
- int account2.number = 2;
- String account2.name = "Zoe";
- String account2.address = "California";
- account2.view();
- }
- }
- class Account {
- int number;
- String name;
- String address;
- void view() {
- System.out.println("Number: " + number);
- System.out.println("Name: " + name);
- System.out.println("Address: " + address);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment