FirstJavaProgram

FirstJavaProgram - //Line 12 secondNum = console.nextInt();...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
I import java.util.*; //Line 1 i public class FirstJavaProgram //Line 2 { //Line 3 static final int NUMBER = 12; //Line 4 static Scanner console = new Scanner(System.in); //Line 5 public static void main(String[] args) //Line 6 { //Line 7 int firstNum; //Line 8 int secondNum; //Line 9 firstNum = 18; //Line 10 System.out.println("Line 11: firstNum = " + firstNum); //Line 11 System.out.print("Line 12: Enter an integer: ");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //Line 12 secondNum = console.nextInt(); //Line 13 System.out.println(); //Line 14 System.out.println("Line 15: secondNum = " + secondNum); //Line 15 firstNum = firstNum + NUMBER + 2 * secondNum; //Line 16 System.out.println("Line 17: The new value of " + "firstNum = " + firstNum); //Line 17 } //Line 18 } //Line 19...
View Full Document

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Ask a homework question - tutors are online