Skip to main content

Posts

Showing posts with the label feature of java

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...

Features of Java:

Features of Java: In   Java Programming language we introduce with some keyword like Object-oriented, Simple, Portable Platform independent   etc.   Yes! These are feature of Java. There are many features in Java. They are also known as java buzzwords. The main features of Java are: Simple Object-Oriented   Portable   Platform independent     Secured     Robust   Architecture-neutral   Dynamic     Interpreted     High Performance     Multithreaded     Distributed The Java Features are given below in detail. Simple Java is easy to learn and its syntax is quite simple, clean and easy to understand. The confusing and ambiguous concepts of C++ are either left out in Java or they have been re-implemented in a cleaner way. No need to remove unreferenced objects because there is Automatic Garbage Collection in java. E.g.: Pointers and Operator Over...