Switch to full style
General Java code examples
Post a reply

show the content of set

Fri May 14, 2010 9:49 am

Iterate on a java set object . Iteration in this example use of Long objects . Actually the code is so simple to understand ,but the idea is used so frequent.

Code:

    
public void showSetOntent(Set<LongsetLongs){
        if(
setLongs==null || setLongs.isEmpty()){
            return;
        }
        
        
Iterator<Longiterator setLongs.iterator();
        while(
iterator.hasNext()){
            
System.out.println("Show current content = "+iterator.next());
        }
        }
 




Post a reply
  Related Posts  to : show the content of set
 Hide the content of the div     -  
 Web content & Website Design     -  
 lowercase table content     -  
 Read the content from directory     -  
 check folder content using asp     -  
 Re: An example show what is LAN     -  
 usage of the meta tag for content encoding     -  
 Convert TreeSet content to array     -  
 Change the content of select tag using JQuery     -  
 Read XML file content using SAX and writing its as SQL     -  

Topic Tags

Java Collections