1 Reply Latest reply: Nov 3, 2007 5:26 AM by 807600 RSS

    My program consists of one main method and one boolean method.....

    807600
      How to do this ?

      The following is the boolean method.:

      public boolean chk()
           {
                API s=new API();
                str1=("v3r2");
                for(int i=0;i<str.length;i++)
                {
                if (str.equals(str1)){
                          
                return true;
                
                }
                return false;

      The main method should print the return type ( true/false) depending on the condition each time the loop is executed.

      ie checking a condition in boolean method and printing the corresponding boolean variable in the main method.

      How to do this ?