5:35 pm - Thursday August 17, 2017

check whether LinkedList is empty using Another way boolean isEmpty()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

BACK

       This tutorial explains how  to check whether  LinkedList is empty using another way boolean isEmpty() method.

Example

import java.util.LinkedList;
public class CheckElementempty
{
public static void main(String a[])
{
   LinkedList<String> ll = new LinkedList<String>();
   ll.add("");
   ll.add("");
   ll.add("");
   ll.add("");
   ll.add("");
   System.out.println("The size of linked List  :"+ll.isEmpty());
 }
}

Output

             The size of linked List  :false

BACK

Filed in: Java Examples

Comments are closed.