Posts

Showing posts from July, 2018

Java 5: Static import

Static import is the feature introduced in java 1.5 release. By using static import, we can directly access static members and methods of another class without class name or object name. Let us understand this with an example, package java5.staticimport; import static java.lang.System.*; public class StaticImportDemo {     public static void main(String[] args) {         out.println("Hello..Welcome to Java 5");     } } Output: Hello..Welcome to Java 5

Java 5 (Tiger) Features

Following are some of the Java 1.5 release: Static import @override annotatio n Covariant return types For each loop Auto Boxing/UnBoxing Varargs Scanner class Generics Type safe Enums java.lang.concurrent package Annotations (Metadata)