Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 92fd6f3

Browse files
shows declaration, initialization, and use of an integer variable
Prints the number of keys on a piano.
1 parent e2cceaf commit 92fd6f3

File tree

1 file changed

+18
-0
lines changed
  • textbook work/java software solutions/2. Data and Expressions

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//********************************************************************
2+
// PianoKeys.java Author: Lewis/Loftus
3+
//
4+
// Demonstrates the declaration, initialization, and use of an
5+
// integer variable.
6+
//********************************************************************
7+
8+
public class PianoKeys
9+
{
10+
//-----------------------------------------------------------------
11+
// Prints the number of keys on a piano.
12+
//-----------------------------------------------------------------
13+
public static void main(String[] args)
14+
{
15+
int keys = 88;
16+
System.out.println("A piano has " + keys + " keys.");
17+
}
18+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /