0% found this document useful (0 votes)
35 views10 pages

64 New Things in Java 7

The document discusses new features in Java versions including lambda expressions, which allow functions to be passed as parameters, and interface default methods, which allow interfaces to provide a default implementation for methods. It also mentions comparing Person objects by name and testing skills with Java version 1.8. The agenda covers recalling previous features, versions available, lambda expressions, interface default methods, and testing skills.

Uploaded by

amanish05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views10 pages

64 New Things in Java 7

The document discusses new features in Java versions including lambda expressions, which allow functions to be passed as parameters, and interface default methods, which allow interfaces to provide a default implementation for methods. It also mentions comparing Person objects by name and testing skills with Java version 1.8. The agenda covers recalling previous features, versions available, lambda expressions, interface default methods, and testing skills.

Uploaded by

amanish05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Kumar, Manish

Department of Computer Science


Break the ice.

Why Java has given Interface?


Agenda
Versions available
Recalling previous features o

3
Lambda Expression

Lambda is a function, used for computation that take


parameter and return value
Until Java 8, functions could only be implemented using
methods
A Lambda enables functions to be passed around as store like
data
Continue..

More like functional programming


It opens the door of functional programming, where we will be
passing the function as parameter
Understanding .
List<Person> list = ..;

Class ComaprePersonByName() implements Comparator<Person>{


@override
public int compare(Person p1, Person p2)
return p1.getName().comapreTo(p2.getName());
}

Collection.sort(list, new ComaprePersonByName());


Test Your Skills

Java version 1.8


Interfaces Default Methods

An Interface can declare a method and can provide a default


implementation to it.
It gives a developer is use the interface at fullest because as we
know a class can implement as many interfaces and only one
class.
Keyword default is used for only sole purpose, dont hurt
backward compatibility.
64
55 New Things in Java 7
Insert Presenters Name Here
Insert Presenters Title Here

ORACLE
Presenting with THIRD PARTY COMPANY
PRODUCT
LOGO
LOGO
Insert Picture Here

You might also like