User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,475 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,766 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting

using a varible from main method

Join Date: Sep 2004
Posts: 84
Reputation: jerbo is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
jerbo jerbo is offline Offline
Junior Poster in Training

Re: using a varible from main method

  #5  
Nov 24th, 2004
Try this (in reference to passing the variable):
public class work {

   public static void main (String [] args) {
      boolean booleanAnswer;
      int number = 1;
      // Passes copy of number to ifstate
      booleanAnswer = ifstate(number);  
   }

   public static boolean ifstate(int passedNumber) {
      if ( passedNumber == 0 )
         //blah blah
   }

Let me know if it is not clear

}//end class
Reply With Quote  
All times are GMT -4. The time now is 2:34 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC