diff --git a/demo.java b/demo.java new file mode 100644 index 0000000..8fedcd7 --- /dev/null +++ b/demo.java @@ -0,0 +1,31 @@ +import java.util.*; +public class array +{ + String name; + int age; + void employee(String name,int age) + { + this.name=name; + this.age=age; + } + public static void main(String[] args) + { + + employee e1 = new employee("sankeerth",18); + employee e2 = new employee("Sudeep",17); + + ArrayList ar3 =new ArrayList(); + ar3.add(e1); + ar3.add(e2); + + Iterator it=ar3.Iterator(); + while(it.hasnext()) + { + employee emp=it.next(); + System.out.println(emp.name); + System.out.println(emp.age); + } + + } + +} diff --git a/hello.java b/hello.java new file mode 100644 index 0000000..c71bbac --- /dev/null +++ b/hello.java @@ -0,0 +1,12 @@ +class helloworld +{ +void getclassName() +{ +System.out.println(this.getClass()); +} +public static void main(String args[]) +{ +helloworld cs = new helloworld(); +cs.getclassName(); +} +}