How Programmers Life Can Bring a Smile to Your Face

I stumbled upon the site thecodinglove.com and just loved it . I want to use the images and quotes to share their  awesome work with you guys . Guess what! they have granted the permission . Although there are thousand of images to choose from the website . I am sharing which relates the most of programmer's lives.This is hilarious, so, pause your day and bring a smile to your face.




When a newbie suggests  to add a new feature to project



Fixing minor bugs




Java 8 new features : Lambda expressions , optional class , Defender methods with examples

In JavaOne 2013 , Oracle  reveals the details about the Java 8 .  Java 8 is already released by Oracle last year. It is the most feature rich update then the previous version 6 and 7 , which both were somehow minor updates .

The major features of the java 8 are as follows :

 Introduction of Optional
 Defender Methods
 Lambda Expressions


Read Also :       Java 7 Features Revisited

1. Introduction Of Optional :

The main benefit of Optional is to Avoid null pointer exception : There is another class named Optional in the util package , as it is used to avoid the null pointer exception , If the value is present then it will return the true value otherwise it will show the false value  As it is boolean the value must be between false and true .


In java language , to access an object we use reference type .And when we are unable  to have a specific object to point to , then we set the value of the reference null , indicating it is not pointing to any object .
Null is a literal (also known as constant ) in java .

public static Cat  find(String name, List;Cat; cats) {
   for(Cat cat : cats) {
      if(cat.getName().equals(name)) {
         return cat;
      }
   }
   return null;
}

Method signature shows that  this method may not return a value but a null reference .