CONTROL STRUCTURES:
Three types of control structures:
1.Decision control structure : if,if else,nested if etc
2.Loop control structure : while loop,do..while loop, for loop,break statement,continue statement.
3.case control structure : switch,goto
1.Decision control structure:
ex: if(condition)
{
block of statements;
}
ex: if(condition)
{
block of statements;
}
else{ block of statements;}
ex: if(condition)//NESTED IF
{
if(condition1)
block of statements;
else
block statements;
}
2.Loop control structure:
ex: while(condition)
{
block statements;
}
ex: do
{
block statements;
}while(condition);
ex: for(initalization;condition;increment/decrement)//ex: for(i=0;i<=10;i++/i--)
{
block statements;
}
3.Case control structure:
ex: switch(condition)
{
case 1: statements;break;
case 2:statements;break;
default:statements;break;
}
Popular Posts
-
<%@page contentType="text/html" import="java.util.*" %> <!-- http://www.roseindia.net/jsp --> ...
-
Syntax of JSP Scriptles are: <% //java codes %> JSP Scriptlets begins with <% and ends %> .We can embed any a...
-
JSP pages are high level extension of servlet and it enable the developers to embed java code in html pages. JSP files are finally compiled ...
-
package interfaceexercise; // Define an interface with three abstract methods. // Any class that implements this interface has to // impleme...
-
Syntax of JSP Declaratives are: <%! //java codes %> JSP Declaratives begins with with .We can embed any amount of java c...
-
In this section we are going to implement insert data, delete data, and update data using with JDBC database and also using of JavaScript. ...
-
Learning about Properties Every component (form is component for example) has properties, that determine its look and its functioning. Prope...
-
Steps to follow: 1. Write Relation.java as shown in Code-11.5.a below. Please note that the Relation is an interface. (You are welcome to d...
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Using JavaServer Pages...
-
Now I will show you how to retrieve the data posted from a HTML file in a JSP page. Consider an html page that prompts the user to enter his...
No comments:
Post a Comment