Pages

Sunday, 22 September 2019

Optional

Q.What is the alternative to null in Java? Java 8 introduces a new class called java.util.Optional<T> that’s inspired by the ideas of Haskell and Scala. It’s a class that encapsulates an optional value. Q.How do you model the absence of a value?...

Read More

Saturday, 21 September 2019

Double colon operator

Method and Constructor reference by using "::" operator The functional interface method can be mapped to our specified method by using "::" operator. This is called method reference. Our specified method can be either a static or instance method. The functional interface...

Read More

Java 8 in built functions

IN BUILT FUNCTIONS Consumer,Supplier,Function and Predicate all are available under java.util.function package. Comparison  of in built functions Properties Consumer Supplier Function Predicate Purpose To consume some input and perform required operation.It won’t return anything To supply some value base on requirement To...

Read More

Friday, 20 September 2019

Default method

Default Methods In Java 1.8v onwards, you can also define the default method inside the interface. You can define the default method using the keyword default. Default methods are by default available to all implementation classes. Based on our business requirement implementation...

Read More

Tuesday, 17 September 2019

Generic concept

Generic concept

Agenda Introduction Generic Classes Bounded types Generic methods and wild card character Conclusion Introduction The generic concept is introduced in Java 1.5v To resolve two problems of collection. Type safety ClassCastException ArrayList list = new ArrayList();//Non generic a.k.a raw type version till...

Read More

Exception handling

Exception handling

Agenda Exception Exception Handling Benefits of Exception Handling Hierarchy of Exception Keywords related to exception Default exception handling in java The possible combination of try, catch and finally Multi-catch block Try-with resources Custom Exception Assertions Exception An event that disturbs the normal...

Read More
Page 1 of 5123»