Imagine if I have this piece of code:
System.out.println("Is the product:\n"+
"1. National.\n"+
"2. International.");
int choice = input.nextInt(System.in);
if (choice == 1)
(...)
else if (choice == 2)
(...)
So is it okay to do the following?
final int NATIONAL = 1;
final int INTERNATIONAL = 2;
System.out.println("Is the product:\n"+
"1. National.\n"+
"2. International.");
int choice = input.nextInt(System.in);
if (choice == NATIONAL)
(...)
else if (choice == INTERNATIONAL)
(...)
I don't know, I just bought the Clean Code book by Uncle Bob and I started to question myself.