package cp;
import java.util.ArrayList;
import java.util.Iterator;
public class Emmo {
public static void main(String[] args){
HelloWorld he=new HelloWorld("https:www.educoder.net");
HelloWorld h=new HelloWorld(20.432);
ArrayList a=he.getList();
a.add(he);
a.add(h);
//Iterator<HelloWorld> it1=a.iterator();
//System.out.println(it1.next());
System.out.println(a.get(0));
}
}
package cp;
import java.util.ArrayList;
public class HelloWorld {
//public ArrayList a;
String str;
double du;
@SuppressWarnings("unchecked")
public HelloWorld() {}
public HelloWorld(double du) {
this.du=du;
}
public HelloWorld(String str) {
this.str=str;
}
public ArrayList getList() {
ArrayList<Object> a=new ArrayList<>();
return a;
}
}