Thursday 11 July 2013

Java building blocks

Printing to console - 1.  The difference between the print() and println() method is that println() will terminate the line, but print() will allow you to continue the line.
Getting input - 2.  The nextInt() method of the scanner class only accepts whole numbers.

Methods - 3.  A procedure executes processing statements, while a function performs processing and returns a value.  The parameters of a

Variables - 4.  A variable is used to store values inside programs so they can be used again.  The syntax for declaring a variable is:  Type identifier = value;.
String - 5.  The string function that returns the number of characters in a specific string is called the String length() function.
Concatenation - 6.  The concatenation operator is also used as the addition operator.
Int - 7.  The value stored in an int will always be a whole number.
Double - 8.  The value stored in a double will come as a floating point number.
Boolean  - 9.  The value stored as a boolean will be a true false statement.
Constants - 10.  The difference between a constant and a variable is that unlike variables, a constant can not be changed through processing.
Arithmetic - 11.  The addition operator is used to add together values, the subtraction operator subtracts values from each other, the multiplication operator is used to multiply values together, the division operator is used to divide values,
String functions - 12.  The String.valueOf function can be used to have working equations in the code.