
Lambda Expression Syntax:
Below is syntax of Lambda,
(argument-list) -> {body}
Where as
1) Argument-list: can be zero or more arguments
2) Arrow-token: It is mandatory, and separates arguments and body of expression.
3) Body: can contain zero or more statements
Lambda without Parameter
() -> {
//Body of no parameter lambda
}
Lambda with single argument
(p1) -> {
//Body of single parameter lambda
}
Lambda with two arguments
(p1,p2) -> {
//Body of multiple parameter lambda
}
Similarly Lambda can have any number of arguments
How above Lambda, can be used:
For example, Lambda can be used in TreeSet, to specify sorting order of element.
Below is syntax, for TreeSet, to sort in descending order
TreeSet<String> tss = new TreeSet<>((s1,s2)->s2.compareTo(s1));
Above can be rewritten as
TreeSet<String> tss = new TreeSet<>((s1,s2)->{ return s2.compareTo(s1); } );
So, when there is only single return statement, { } & and explicit return are not required.
Lambda expression is a compact form of Anonymous Inner class, and advantage of using Lambda is, it’s make Code more Compact
TreeSet, example in previous, can be rewritten as
TreeSet<String> tss = new TreeSet<>( new Comparator(){ public int compare(String s1, String s2){
return s1.compareTo(s2);
}});
In Multi threading, for Runnable interface and also in Collection Streams
Welcome to the only Highest Rated Core Java Course, and fully loaded Core Java course with Practical Hands on examples, of every concept.
This is the only Core Java course with about 155+ downloadable source code programs, 100+ coding exercises, MCQs for all relevant lectures(to recap/memorize learnings after the Lecture) as the right course need to comprise not only Watchable videos, but also sufficient practice exercises, to make you strong Programmer.
All above comprises 80+ to 100 hours of total learning duration.
With investment of just few Dollars to buy this Course, set strong foundation for your future Software Career. And the Author has been using Java, almost since it's birth.
With 23 years of real time software development experience(at PayPal, CSC, Aricent, Philips, Sasken, etc...), Author has designed in such a way that Learners get very good insight & working expertise on Core Java, and will be in a position to develop projects, at the completion of this course.
Since Core Java sets your foundation for your Future Career, you need the right course to start with and to boost your career, and
You can get started with this course, even with zero/basic to intermediate prior knowledge in Programming.
Rather than just explaining the Concept, there is a focus on Why each specific concept exists and how it adds value, and how to apply it the right way, in your programming.
Topics Covered by this course
Core Java Basics
OOPs(Object Oriented Concepts) - class, constructor, access specifiers, objects, etc...
Packages, Sub Packages
Inheritance
Exception Handling
Multithreading
Collection Framework & Streams
Java 8 Features
Latest features of Java 9 and above
Java Input Output Streams
Network and Socket Programming
MySQL and How Java Program can connect to database
Regular Expressions
Inner class,
Design Patterns overview
Servlets
Project work, at the end of course, adds more value for your Learning.
Topics to be added(shortly) to this course are JSP/Servlets, Reflection, ... and many more.
Every lecture has, below
Video
Downloadable Source code examples, developed in above Video
Reading Material, for every concept
Quiz - Multiple Choice Questions, to cross check your confidence levels
Assignments Questions, to try Coding exercises
All above contributes to 80(or more) Learning Hours, and you will continue to have access to new Topics which will be added by Author, shortly.