This discussion is archived
1 Reply Latest reply: Nov 3, 2007 3:26 AM by 807600 RSS

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

807600 Newbie
Currently Being Moderated
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 ?