Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Output?? (http://www.go4expert.com/forums/output-t7692/)

gouri.83 3Dec2007 22:35

Output??
 
Code:

public class ArrayListDemo {

      public static void rotate(List<?> list) {
              if (list.size() == 0)
                      return;
              list.add(list.remove(0));
      }

      public static void main(String[] args) {
              ArrayListDemo ald=new ArrayListDemo();
              List<String> demo=new ArrayList<String>();
              demo.add("uk");
              ald.rotate(demo);
              if(demo.size() > 1) {
                      System.out.println("i know surely size >1");
              }else {
                      System.out.println("this cannot happen...size is
0");
              }
      }
}


shabbir 3Dec2007 23:17

Re: Output??
 
Submitted as an article and moved to forum for discussion


All times are GMT +5.5. The time now is 00:27.