Where to use curly brackets in Java 1 Class public class MyClass attributes and methods 2 Method public static void main String args method code 3 If other Java code if

Document Sample
Where to use curly brackets in Java 1 Class public class MyClass attributes and methods 2 Method public static void main String args method code 3 If other Java code if Powered By Docstoc
					Where to use curly brackets in Java
1. Class public class MyClass { // attributes and methods }

2. Method public static void main(String [] args) { // method code }

3. If // other Java code if(test_condition) { // code to run if test evaluates to true }

4. If-Else // other Java code if(test_condition) { // code to run if test evaluates to true } else { // code to run if test evaluates to false }

5. For // other Java code for(int loop = 0; loop < maxLoop; loop++) { // code to loop through }

6. While // other Java code while(test_condition) { // code to execute whilst test_condition remains true }

7. Do-While // other Java code do { // code to execute whilst test_condition remains true } while(test_condition);

8. Switch // other Java code switch(value) { // case statements }


				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:61
posted:11/29/2009
language:English
pages:2
Jun Wang Jun Wang Dr
About Some of Those documents come from internet for research purpose,if you have the copyrights of one of them,tell me by mail vixychina@gmail.com.Thank you!