The Artima Developer Community
Sponsored Link

Java Answers Forum
check this out....what is the output

1 reply on 1 page. Most recent reply: Nov 7, 2008 5:32 AM by Vincent O'Sullivan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
sheela tiwari

Posts: 3
Nickname: tiwari08
Registered: Nov, 2008

check this out....what is the output Posted: Nov 6, 2008 12:44 AM
Reply to this message Reply
Advertisement
public class Test {
public static void main(String[] args) {
HashSet s = new HashSet();
for(short i = 0; i<100;i++){
s.add(i);
s.remove(i-1);
}
System.out.println(s.size());
}
}


Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: check this out....what is the output Posted: Nov 7, 2008 5:32 AM
Reply to this message Reply
Compare the type of data that you're adding with the type of data that you are removing.

Flat View: This topic has 1 reply on 1 page
Topic: beginner in Java Previous Topic   Next Topic Topic: a beginner's question

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use