147k views
5 votes
Find and change the error in this code.

// INSTANCE VARIABLE

public class Main {



public static void main(String[] args) {



Product prod1 = new Product();

prod1.Barcode = 123456;



Product prod2 = new Product();

prod2.Barcode = 987654;



System.out.println(prod1.Barcode);

System.out.println(prod2.Barcode);

}

}



public class Product {

public int Barcode;

}

User Venice
by
5.3k points

1 Answer

4 votes

Answer:

987654

Step-by-step explanation:

User Shamdor
by
4.7k points