visit @ http://www.infotechcomputer.in INFOTECH Computer Education, Kishangarh (Raj) 9829171122 Page 1 Chapter 3 Java Revision Tour Rapid Appication Development - It is a method of developing software through the use of pre programmed tools and wizards. it helps the programmer to deve lop programs and softwares rapidly. IDE - Integrated Development Environment ) - It is a programming environment provided to programmer which helps of programming to perform various tasks. Netbeans is an Integrated Development Environment for Java. other one is eclipse Components of IDE 1. Title Bar 2. Menu Bar 3. Toolbar 4. GUI Builder 5. The Palette 5. Inspector Window 7. Properties Window 8. Code Editor Window etc .
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Rapid Appication Development - It is a method of developing software through the use of preprogrammed tools and wizards. it helps the programmer to develop programs and softwares rapidly.
IDE - Integrated Development Environment ) - It is a programming environment provided to programmer
which helps of programming to perform various tasks. Netbeans is an Integrated Development
in the above if construct dotted lines are represented as a block. a block always starts with a { symbol
and ends with a } symbol.
Note: if there is only one statement in any (if, while , do-while , for) construct then we can omit theblock characters ( { ..... } ). In this case Only a single line will be termed as a block in that construct.
Null or Empty Statement : We know that all of the java statements are terminated with a semicolon
symbol. if there is only a semicolon in a java statement then it can be termed as a empty or null
statement for example
;
JAVA PROGRAMMING CONSTRUCTS :
In java there are three types of programming constructs just like any other programming language.
these basic programming constructs are1. sequence
2. selection
3. iteration
1. Sequence :
it means any set of statements in a java program that are executed in a sequence
2. Selection : it means the execution of a statement or a set of statements depending upon a condition
test. if the given condition is true then one set of statements execute otherwise the other set executes.
it is also called as decision construct. Normally if , switch and conditional statement comes into this
3. Iteration : it is also called as a loop. here a statment or a set of statements are executed repeatatively
based on a given condition test. while, do-while and for loop comes into this category of constructs.
Selection Statements in Java : In java there are two Selection Statements
1. If Statement
a. Simple If Statement
b. If - else statement
c. Nested If Statement
d. conditional Statement
2. Switch Statement
1. If Statement
: if we want to execute a statement or a set of statements according to a given condition
or criteria then we use simple if statement as follows:
if (a>b && a>c)
{
sout ("Largest is "+a);
}
2. If - else statement : if we want to execute a statement or a set of statements among the two sets
according to a given condition or criteria then we use if - else statement as follows :if (a>b)
{
sout("Largest is "+a);
}
else
{
sout("Largest is "+b);
}
3. Nested If statement : if there are various conditions to be check to execute a set of statments amongthe few sets then we use nested if statement as follows :
Each of the loop contains the following basic components
1. Initialization Expression (a=1)
2. Test Expression (a<=10)
3. Update Expression (a++)
4. Body of the Loop {......}
1. While Loop - when we want to execute a statement or a set of statements repeatatively a number of
times according to a given condition or criteria then we use while loop. it comes under the category of
conditional looping. when we do not know about the exact number of repeatative executions of the setof statements then we use while loop. its syntax and example is as follows :
syntax.
initialization expression
while (test expression)
{
.
body of the loop
.
update expression
}
Example
a=1;
while(a<=10)
{
sout(a);
a++;
}
2. Do - while loop - It is same as while loop but the basic differences between while loop and do - whileloop are as follows :
While Do While
1. While is a entry controlled loop it is an exit controlled loop
2. While is also called as Top-tested or pre-tested loop it is also called as bottom-tested or
post-tested loop
3. it is not necessary that this loop must execute at least once it is necessary that this loop will execute