Programming Fundamentals/Variable Examples Java

Overview
The following examples demonstrate data types, arithmetic operations, and input in Java.

Output
Integer i = 1234567890 Double d = 1.23456789012345 String s = string Boolean b = true

Discussion
Each code element represents:
 * begins a comment
 * begins the Data Types program
 * begins a block of code
 * begins the main function
 * defines an integer variable named i
 * ends each line of Java code
 * defines a double floating-point variable named d
 * defines a string variable named s
 * defines a Boolean variable named b
 * assign literal values to the corresponding variables
 * calls the  standard output print line function
 * ends a block of code

Output
a = 3 b = 2 a + b = 5 a - b = 1 a * b = 6 a / b = 1 a % b = 1

Discussion
Each new code element represents:
 * represent addition, subtraction, multiplication, division, and modulus, respectively.

Output
Enter Fahrenheit temperature: 100 100° Fahrenheit is 37.7777777777778° Celsius

Discussion
Each new code element represents:
 * defines an object to read from standard input
 * reads input as a double floating-point value