Friday 12 August 2016



·         JDK Alpha and Beta (1995)    
·         This version public release had highly unstable APIs
·         JDK 1.0 (23rd Jan, 1996)
·         Codename was OAK
·         JDK 1.1 (19th Feb, 1997)
·         New features of JDK 1.1
1.      JDBC
2.      RMI
3.      JavaBeans
4.      Inner Class
·         J2SE 1.2 (8th Dec, 1998)
·         Codename was Playground
·         Features of J2SE 1.2
1.      Collection Framework
2.      JIT Compiler( Just In Time Compiler)
3.      Audio support in Applets
4.      Java plug-in
5.      The Swing graphical API was integrated into the core classe
·         J2SE 1.3 (8th May, 2000)
·         Codename was Kestrel
·         Features of J2SE 1.3
1.      Java Plateform Debugger Architecture
2.      Java Naming And Directory Interface (JNDI)
3.      Java Sound
·         J2SE 1.4 (6th Feb, 2002)
·         Codename was Merlin.
·         Features of J2SE 1.4
1.      Integrated XML parser and XSLT processor
2.      logging API
3.      Regular expression
4.      Preferences API
5.      Assertions
6.      Chained Exception
7.      Image I/O API
·         J2SE 5.0 (30th Sep, 2004)
·         Codename was Tiger.
·         Features of J2SE 1.5
1.      Autoboxing/Unboxing
2.      Generics
3.      Varargs
4.      Enhanced ‘for each’ loop
5.      Metadata also called Annotations
6.      Static Imports
·         Java SE 6 (11th Dec, 2006)
·         Sun replaced the name “J2SE” with Java SE
·         Codename was Mustang.
·         Features of J2SE 1.6
1.      JDBC 4.0 support
2.      Java Compiler API: An API allowing a Java program to select and invoke a Java Compiler programmatically.
3.      Support for pluggable annotations
4.      Scripting Language Support
5.      Improved Web Service support through JAX-WS
·         Java SE 7 (28th July, 2011)
·         Codename was Dolphin
·         Features of Java SE 7
1.      JVM support for dynamic languages.
2.      String in switch statement
3.      Automatic resource management in try-statement
4.      Timsort is used to sort arrays instead of merge sort
5.      single catch block can handle more than one type of exception
·         Java SE 8 (18th March, 2014)




Tuesday 28 June 2016

Continue Statement in Java

Java Continue Statement

The Java continue statement is used to continue loop. It continues the current flow of the program and skips the remaining code at specified condition. In case of inner loop, it continues only inner loop.
Syntax:
  1. jump-statement;    
  2. continue;   

Java Continue Statement Example

Example:
  1. public class ContinueExample {  
  2. public static void main(String[] args) {  
  3.     for(int i=1;i<=10;i++){  
  4.         if(i==5){  
  5.             continue;  
  6.         }  
  7.         System.out.println(i);  
  8.     }  
  9. }  
  10. }  
Output:
1
2
3
4
6
7
8
9
10

Java Continue Statement with Inner Loop

It continues inner loop only if you use continue statement inside the inner loop.
Example:
  1. public class ContinueExample2 {  
  2. public static void main(String[] args) {  
  3.             for(int i=1;i<=3;i++){    
  4.                     for(int j=1;j<=3;j++){    
  5.                         if(i==2&&j==2){    
  6.                             continue;    
  7.                         }    
  8.                         System.out.println(i+" "+j);    
  9.                     }    
  10.             }    
  11. }  
  12. }  
Output:
1 1
1 2
1 3
2 1
2 3
3 1
3 2
3 3
 

Break Statement in Java

Java Break Statement

The Java break is used to break loop or switch statement. It breaks the current flow of the program at specified condition. In case of inner loop, it breaks only inner loop.
Syntax:
  1. jump-statement;    
  2. break;   
java break statement flowchart

Java Break Statement with Loop

Example:
  1. public class BreakExample {  
  2. public static void main(String[] args) {  
  3.     for(int i=1;i<=10;i++){  
  4.         if(i==5){  
  5.             break;  
  6.         }  
  7.         System.out.println(i);  
  8.     }  
  9. }  
  10. }  
Output:
1
2
3
4

Java Break Statement with Inner Loop

It breaks inner loop only if you use break statement inside the inner loop.
Example:
  1. public class BreakExample2 {  
  2. public static void main(String[] args) {  
  3.             for(int i=1;i<=3;i++){    
  4.                     for(int j=1;j<=3;j++){    
  5.                         if(i==2&&j==2){    
  6.                             break;    
  7.                         }    
  8.                         System.out.println(i+" "+j);    
  9.                     }    
  10.             }    
  11. }  
  12. }  
Output:
1 1
1 2
1 3
2 1
3 1
3 2
3 3

Java Break Statement with Switch

To understand the example of break with switch statement, please visit here: Java Switch Statement.