Académique Documents
Professionnel Documents
Culture Documents
Last Assignment
asgn1
asgn2
System.out.println("\"Can
Storing data
In Java, Data can be stored as
Numbers
2, 6.67, 0.009
Characters
c, p, ?, 2
Strings
data, Hindi language, $99,
www.rediff.com
int1
Program
int2
Comments(double slash)
Not executed
For documentation
Can be placed on any line
Anything written after // is not executed
E.g.
// this is a comment
Types of numbers
float1
int
Whole numbers like 0, 575, -345 etc.
double
Numbers with decimal point
like 12.453, 3.432, 0.0000002
Variable declaration
Assignment
int3
int5
Storage area
10
int4
Assignment
int a , b ;
a = 4;
b = 7;
a = b;
b = a;
a = 5;
April 29, 2016
// a =? b = ?
// a = 4 b = ?
// a = 4 b = 7
// a = 7 b = 7
// a = 7 b = 7
// a = 5 b = 7
Java Tutorial series part
2
Character data
char1
char2
Characters
a, A, c , ? , 3 ,
(last is the single space)
10
String data
string1
string2
string3
11
Practice problem
Try to print these two figures on the screen using println and least
number of strings
*******
*****
***
*
***
*****
*******
**********
*
*
*
*
*
*
**********
12
Thank you
13