System.out.println(vc.elementAt(i).test3());
the test3() method of my object is being underlined..I know I am retrieving an abject from vc.elementAt(i),then why is the method test3() being underlined??
Expand|Select|Wrap|Line Numbers
- import java.util.*;
- public class MITlab2 {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- test_vector1();
- }
- public static void test_vector1(){
- test_class vm=new test_class();
- Vector vc=new Vector();
- vc.add(vm);vc.add(vm);vc.add(vm);
- System.out.println(vc.size());
- for (int i=0;i<vc.size();i++){
- System.out.println(vc.elementAt(i).test3());
- }
- }
- }
- class test_class{
- public String vim="testing";
- public boolean test3(){
- return true;
- }
- }