Skip to main content

Posts

Showing posts from June, 2016

Why Java is Purely Object Oriented Language Or Why Not

Some years back when I have started learning Java I get to know that Java follows Object Oriented Programming paradigm and everything in Java is an object either it is a String (which was a char array in C) or an array itself. But later on I found on Internet people saying that Java is actually not purely Object Oriented because everything in Java is not an object, for example: All primitive types ( char, boolean, byte, short, int, long, float, double ) are not objects because we are not able to do any object like operation (using . and calling methods) on them. I have also found some people some saying that all static content (variables and methods) does not belong to any object so they are non object things. Due to my little bit knowledge and less experience I easily accepted these reasons and started to believe that Java is not a purely Object Oriented Programming Language. But later on I found that for every object JVM creates two objects The object itself. And one Class level ob

Java Lambda Expression Explained with Example

Java 8 is one of most popular release in the history of Java and have introduced lots of major features like Lambda Expression, Method Reference, Stream API, new DateTime API, Default and static interface methods etc.. For complete list of new Java 8 feature read What’s New in JDK 8 article by oracle itself. In this article, we are going to study Java Lambda Expression in details e.g. what is the lambda expression, why it so popular, what are the advantages of the lambda expression, what purpose is solved, how it differs from anonymous classes and why/how should we use it. Why Java needs Lambda Expression Java is a multiparadigm programming language (Supports Object Oriented, Imperative, Structured, Declarative style of programming). However, most of its design architecture is influenced by Object Oriented programming style. And there are two variations of object-oriented programming (OOP) style Class-based OOP style Prototype-based OOP style → doesn’t support inheritance Java supp