attention@computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com
Programming Instructions In JAVA
Output Statements:
The println( ) method or the function is used to display information on the screen. It also provides a line feed i.e. transfers the control to the next line of the output.
// Example program to utilize println( ) method class output
{ public void display()
{int a=10;
int b=20;
int c=30;
int d=40;
System.out.println("The usage of println( ) method"); System.out.println("The value of a is "+a); System.out.println("The value of b is "+b); System.out.println("The value of c is "+c); System.out.println("The value of d is "+d);
}}
attention@computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com
Remark Statement of JAVA
The Java language offers provision of remark within its program in the following three ways :
(i). Using /* and */
eg. /* This program prints the sum of two numbers */ (ii). Using // for a single line of comment.
eg. // This program prints the sum of two numbers (iii). Using /** and */
eg. /** This program prints the sum of two numbers */
attention@computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com
Data Types (int)
Type Size Min. Range Max.Range byte One Byte -128
127
short Two Bytes -32,768
32,767
Four Bytes -2,147,483,648
To
2,147,483,647
long Eight Bytes -9,223,372,036,854,775,808 To 9,223,372,036,854,775,807
attention@computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com
Data Types (float)
This type of data includes numbers with decimal part or fractional numbers. It is further classified into two types as float and double with references as : Type
Size
Min. Range
Max. Range
float
4
3.4e-038 to
3.4e+038
double
8
1.7e-308 to
1.7e+308
attention@computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com
Escape Sequences in JAVA
Escape
Meaning
Newline
\t
Tab
\b
Backspace
Java Learning Made Easy
Start from the beginning
