Showing posts with label java 8. Show all posts
Showing posts with label java 8. Show all posts

Thursday, July 21, 2016

Java version history from 1.4 to 1.8




1) Java 4 Features :
The important feature of J2SE 4 is assertions. It is used for testing.


  • Assertion (Java 4)




2) Java 5 Features :
The important features of J2SE 5 are generics and assertions. Others are autoboxing, enum, var-args, static import, for-each loop (enhanced for loop etc.


  • For-each loop (Java 5)
  • Varargs (Java 5)
  • Static Import (Java 5)
  • Autoboxing and Unboxing (Java 5)
  • Enum (Java 5)
  • Covariant Return Type (Java 5)
  • Annotation (Java 5)
  • Generics (Java 5)



Thursday, May 01, 2014

What's New in Java 8 - Lambda Expressions

Introduction :

Lambda Expressions enable us to treat functionality as a method argument or code as data . Well, What is functionality as a method argument? Did we already use this before? Yes, the answer is yes, we already used this concept before with anonymous classes. In anonymous classes case, we are usually trying to pass functionality as an argument to another method. Lambda expressions are also to do this. Although  anonymous classe is often more concise than a named class, for classes with only one method, even an anonymous class seems a bit excessive and cumbersome.

Usage :

First let us  discuss the usage of  the Lambda Expressions then will go through the syntax of Lambda Expressions.Suppose that you are creating an application for car sellers. You are asked to create a feature that search cars by certain criteria.
Car class can be represented as follows.
public class Car{
    public enum Color {
        BLACK, WHITE, RED
    }
    public String modelName;
    public Color color;
    public int engineCC;
    public void printModelName() {
        // ...
    }
}
Now you need to implement a feature that search for cars that match one characteristic such as engine cc.One simplistic approach is  create a method that  searches for cars that match one characteristic, such as engine cc. The following method prints Model name that are greater than the specified engine CC.

Understanding Essential DNS Record Types for Web Administrators

  Understanding Essential DNS Record Types for Web Administrators Introduction The Domain Name System (DNS) acts as the backbone of the inte...