JavaDeploy
SiteMap
Java Certification
Java Beans
Java-OO Concepts
Control Flow
«Prev
Java Certification
Java Fundamentals
Automatic Initialization
Identifiers Keywords
Classes Objects
Object Oriented Programming
Class Interface Declarations
Subclasses Superclasses
Class Constructor Syntax
Types Of Nested Classes
Interface Use Declaration
Inner Class
Local Inner Classes
Anonymous Inner Class
Classes Objects - Conclusion
Anonymous Class - Quiz
Java Operators
Java Casting - Quiz
Declaring Java Methods
Declaring Variables
Exception Handling
Garbage Collection
Java Threading Model
Multithreading Theory
Starting Threads
Thread States
Ready to Running State
Waiting Dying Threads
Synchronized Shared Objects
Synchronization Concepts -Quiz
Waiting Notifying Threads
Preventing Thread Execution
Threading Model Conclusion
Overview of Java Statements
1) Assignment Statement in Java: The value of the variable is updated with the result of the expression.
2) Method invocation statement: The print() method of the out object is invoked, passing the value of s as an argument.
3) Declaration statement: The s variable is declared as being of the String type.
4) if-statement: The condition in an if statement must be a Boolean expression. The else clause may be omitted.
5) Switch statement: The switch value and the case values must evaluate to int values after numeric promotion.
6) Switch statement (continued)- If a break statement is executed, execution continues after the switch statement.
7) For statement: The code surrounded by the for statement is executed for values of i from 0 to the length of s minus 1.
8) End of for statement: This is where the for statement ends.
Modern Java
9) While statement: First, the condition is evaluated. If the condition is true, the nested statements are executed. If it is false, the statement after the while statement is executed. When the nested statements have executed, the condition is evaluated again.
10) Do statement: The nested statements are executed. The condition is evaluated. If the condition is true, the nested statements are executed again. If the condition is false, the next statement after the do statement is executed.
11) Break statements: Breaks without labels terminate execution of an enclosing switch, for, while, or do statement. Breaks with labels terminate execution of an enclosing statement with a matching label.
12) Continue statements: The continue statement terminates the current loop iteration (for, while, or do statement). A label may be used to identify the loop whose iteration is being terminated.
13) Return statement: Return statements return the value of an expression of the method's return value. If a method's return type is void, then the return statement does not return a value.
14) Throw statement: A throw statement throws an exception, which is an object of a subclass of java.lang.Throwable.
15) Try-catch statements: An exception that is thrown in the try clause may be caught and handled by a catch clause.
16) Synchronized statements: The lock on the object being synchronized must be acquired before the synchronized statement is executed.