• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

addAll and ContainsAll method in collection

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
package welcome;
import java.util.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class prasjuly20 {
static int a=10;

private void foo() {
System.out.print("hi");
}
public void gi() {
System.out.print("go go go");
}
protected void pr() {
System.out.print("go faf");
}

}
class pa extends prasjuly20 {

int b;
int a=11;
public void h() {
System.out.print("hi");
System.out.print(a);
}

public static void main(String [] arg) {

List l=new ArrayList();
prasjuly20 pd1=new prasjuly20();

prasjuly20 pd=new pa();
pd.gi();
pa pf=new pa();
pf.pr();
// pd.gi();
// prasjuly20 pd1=new prasjuly20();


l.add("ho");
l.add("hi");
l.add("prasanna");
l.add("foo foo foo ");
l.add(new Integer(42));

System.out.print( l.contains("ho"));
System.out.print( l.addAll(l));
System.out.print( l.addAll(l));
System.out.print(l.containsAll(l));
// l.clear();



Iterator i = l.iterator();
while (i.hasNext()) {
System.out.println(i.next());
}
System.out.print( l.addAll(l));


}
}


what is addAll and containsAll method do here
 
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by prasanna sheregar:
what is addAll and containsAll method do here


Have a look at the API documentation for addAll and containsAll.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't post the same question question multiple times. Now you have answers here and here. This duplication is a waste of people's time, who are trying to help you, after all.
 
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic