Results 1 to 3 of 3
  1. #1
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default Cannot find symbol variable pD! I cant fix it!!!

    I know, I have had this before! But now for some reason I cant make a variable static!

    Heres My first code, the code that runs first:

    PHP Code:
    package src;
    
    import some poopy modules..;
    
    public class run{
    	public static void main(String args[]){
    		double pD = 0.0;
    		try{
    			GameFrame window = new GameFrame();
    			
    		} catch (Exception e){
    			e.printStackTrace();
    		}
    	}
    
    }
    and heres my other code, the one not working:

    PHP Code:
    package src;
    
    
    import src.run;
    
    public class Crypt {
    
    
    	private static String encrypt(String string){
                    blah blah blah things...
    	   	displayProgress(x/Double.valueOf(list.length));
    		blahblahblah more things running.. Unimportant.
        }	
      
        private static void displayProgress(double value){
        	run.pD = value*100;
        }
    Now the problem is, I cant make the pD value static by saying static double pD cause I doesnt work!

    So how do I make the displayProgress be able to find the pD value?
    For me its impossible!

  2. #2
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    nvm trash this!
    Im making a new thread with more explaining and just one simple question.

  3. #3
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    Java Code:
    package src;
    
    import some poopy modules..;
    
    public class run{
        public static double pD;
        public static void main(String args[]){
            pD = 0.0;
            try{
                GameFrame window = new GameFrame();
                
            } catch (Exception e){
                e.printStackTrace();
            }
        }
    
    }
    My Hobby Project: LegacyClone

Similar Threads

  1. Cannot find symbol variable yourScore
    By Addez in forum New To Java
    Replies: 4
    Last Post: 08-17-2009, 10:48 PM
  2. cannot find symbol
    By GabWit in forum New To Java
    Replies: 3
    Last Post: 01-25-2009, 12:13 AM
  3. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  4. Replies: 3
    Last Post: 05-01-2008, 08:30 AM
  5. Error: cannot find symbol
    By silvia in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •