Submitted by heartin on Sun, 10/20/2013 - 21:31
Looping constructs in Java are:
-
For statement
-
For-each statement
-
While statement
-
Do while statement
We will see for and for-each here. We will see while, do while, break and continue statements in next note.
The for statement
Syntax of for loop is:
Submitted by heartin on Mon, 09/30/2013 - 10:05
Decision control statements can change the execution flow of a program.
Decision control statements in Java are:
-
if statement
-
Conditional operator
-
switch statement
Submitted by heartin on Mon, 09/30/2013 - 01:06
Literals are numbers, characters, and string representations in your program. Literals can be classified as numeric literals, character literals and string literals.
Submitted by heartin on Sun, 09/29/2013 - 03:22
Casting is the conversion of data of one type to another type either implicitly or explicitly.
Casting happens for both primitive types and reference types.
If the casting operation is safe, java will do automatic type casting. This is called implicit type casting.
If java can't be sure whether the casting will be safe, java will not do automatic casting, but programmer can do the casting if he is sure about the outcome. This is called explicit type casting.
Submitted by heartin on Wed, 09/25/2013 - 19:59