Skip to main content

Posts

Showing posts with the label programming Language

List Interface of JAVA 8

List Interface List Interface is the subinterface of Collection. It contains index-based methods to insert and delete elements. It is a factory of ListIterator interface. Lists may contain duplicate elements. The Java platform contains two general-purpose List implementations. ArrayList , which is usually the better-performing implementation, and LinkedList which offers better performance under certain circumstances. List interface includes different operations: #       Query Operations #      Modification Operations #      Bulk Modification Operations #      Comparison and hashing #      Positional Access Operations #      Search Operations #      List Iterators #      view Let’s see the List Interface from java.util pacjage: package java.util; import java.util.function.UnaryOperator; public ...

Iterators in java 8

An  Iterator  is an object that enables you to navigate through a collection and to remove elements from the collection selectively, if desired. You get an Iterator for a collection by calling its iterator method. The following is the Iterator interface . public interface Iterator<E> {     boolean hasNext();     E next();     void remove(); //optional } The  hasNext()  method returns  true  if the iteration has more elements, and the  next()  method returns the next element in the iteration.   The  remove()  method removes the last element that was returned by  next  from the underlying  Collection . The  remove  method may be called only once per call to  next  and throws an exception if this rule is violated. [ Note :  Iterator.remove  is the  only  safe way to modify a...

A brief history of java

A brief history of java: James Gosling The history of Java Language is more interesting. The history of Java starts from “Green Project”. In 1991 The Green Project initiated by James Gosling , Mike Sheridan , and Patrick Naughton . A small group of Sun engineers called the "Green Team" believed that the next wave in computing was the union of digital consumer devices and computers. Led by James Gosling, the team worked around the clock and created the programming language that would revolutionize our world – Java.   The language was initially called Oak ( Oak is a symbol of strength and chosen as a national tree of many countries like U.S.A., France, Germany, Romania etc ). Later the project went by the name Green and was finally renamed Java , from Java coffee (produced in the Java, is an island of Indonesia).  Sun Microsystem s released the first public implementation as Java 1.0 in 1995. It promised "Write Once, Run Anywhere" (WORA), pr...