Tribes (Int)
After the last major migration into the British Isles, new migrants continued to arrive from mainland Europe. Dozens and dozens of tribes formed.
Here is a list of just five of the tribes.
- Silures
- Dubunni
- Belgae
- Regni
- Parisi
Since you now have integers to deal with you can use a variable type called int.
This code illustrates the use of the int variable.
- /**
*This is the way to make a
*multi line comment.
*/ - class Tribes {
- public static void main(String[] args) {
- String tribestatement;
- tribestatement = "Here is a list of just five of the tribes.";
- int tribenumber1 = 1;
- int tribenumber2 = 2;
- int tribenumber3 = 3;
- int tribenumber4 = 4;
- int tribenumber5 = 5;
- System.out.println(tribestatement);
- System.out.println();
- System.out.println(tribenumber1 + ". Silures");
- System.out.println();
- System.out.println(tribenumber2 + ". Dubunni");
- System.out.println();
- System.out.println(tribenumber3 + ". Belgae");
- System.out.println();
- System.out.println(tribenumber4 + ". Regni");
- System.out.println();
- System.out.println(tribenumber5 + ". Parisi");
- }
- }
Use Save As to save the code to your folder as: Tribes.java. Then compile the code in the Command prompt window. Use javac Tribes.java to create the .class file. Execute the program. Use java Tribes to run the program.
Your output should look like this:
c:\javamike>java Tribes
Here is a list of just five of the tribes'
1. Silures
2. Dubunni
3. Belgae
4. Regni
5. Parisi