Posts

Showing posts from June, 2020

Artificial Intelligence Vs Machine Learning Vs Deep Learning

Image
AI vs ML vs DL We are surrounded by multiple technologies. Artificial Intelligence, Machine Learning, Deep Learning, Data Science are common terms nowadays.  People use these terms interchangeably but all these terms are different in terms of definition, application, and limitations.  Nowadays we use many applications that are used in AI. There are many industries that work with AI like Healthcare, E-Commerce, Entertainment, Gaming, Automobile, Education, etc.  Machine Learning and deep learning are used to solve a complex task with huge datasets to make them simple. Artificial intelligence: Artificial Intelligence is a field to make a machine intelligent. AI makes machines to act like human's brains. AI incorporates human intelligence into machines. Intelligence means machines can predict, classify, reason, plan, and perceive like humans. Applications      Self-driving cars like Tesla, Nissan,  Voice Assistants like Siri and Alexa, Amazon Echo Machine Learning It is a subset of AI

Java 8 Vs Java 9

Java 8 Features 1. forEach() forEach(): method is used to iterate the elements. It takes a single parameter. It is a default method of the Iterable interface. We can pass lambda expressions as an argument. public class ForEachExample {     public static void main(String[] args) {         List<String> list = new ArrayList<String>();         list.add("One");         list.add("Two);         list.add("Three");         list.add("Four");         list.forEach(li -> System.out.println(li));     } } 2. Functional Interfaces and Lambda Expressions Functional Interface The Functional interface contains only one abstract method and also contains a number of default and static methods. Functional Interface is annotated by @FunctionalInterface annotation, it ensures that the interface contains only one abstract method. Some predefined functional interfaces are: Runnable, Comparable, and ActionListener.  Lambda Expression Lambda expressions pr

Default Methods in Interface - Java 8

Java interfaces use to have only abstract methods thanks to JDK 8 which allows the interface to add default and static methods. During the application enhancement or maintenance, it may possible that new methods are required to be added in an interface that forced all implemented classes to be changed and implement new abstract methods. Thus we can add these default methods to existing interfaces without breaking the code and changing old implementation classes. interface DefaultMethod {  public default void defMethod(){    System.out.println("Default Method");  } } public class TestDefault implements DefaultMethod{   public static void main(String[] args) {     TestDefault t = new TestDefault();      t.defMethod();    } } Likewise, you can define  default static methods  in an interface with the restriction of not overriding static methods.