
-----------------------------------
KingGrumpz
Fri Jan 11, 2013 5:55 pm

Cannot Find Symbol (checked all obvious problems)
-----------------------------------
Can someone tell why I keep getting a "Cannot find symbol" error in the code  below


import java.util.Scanner;
import java.io.File;
import javax.swing.JOptionPane;
import javax.media.Player;
import javax.media.Manager;

public class Mp3Player
{

   public static void main (String

Mod Edit:

Please wrap you code in either of the following in order to preserve whitespace (indentation) and to highlight the syntax.
 ... code ... 

[code] ... code ... [/code ]
[/code]

-----------------------------------
Insectoid
Fri Jan 11, 2013 6:03 pm

RE:Cannot Find Symbol (checked all obvious problems)
-----------------------------------
What symbol can it not find, and on what line is the error?

-----------------------------------
KingGrumpz
Fri Jan 11, 2013 7:29 pm

Re: Cannot Find Symbol (checked all obvious problems)
-----------------------------------
}while (x != 2);
              ^
  symbol:   variable x
  location: class Mp3Player
1 error

-----------------------------------
Insectoid
Fri Jan 11, 2013 7:48 pm

RE:Cannot Find Symbol (checked all obvious problems)
-----------------------------------
Where are you declaring x?

-----------------------------------
KingGrumpz
Sat Jan 12, 2013 8:27 am

Re: Cannot Find Symbol (checked all obvious problems)
-----------------------------------
Line 21 (int x = 0; )

-----------------------------------
Insectoid
Sat Jan 12, 2013 8:42 am

RE:Cannot Find Symbol (checked all obvious problems)
-----------------------------------
Do you think there might be a better place to declare it?

-----------------------------------
KingGrumpz
Sat Jan 12, 2013 3:04 pm

Re: Cannot Find Symbol (checked all obvious problems)
-----------------------------------
I have declared it in multiple places. none worked.

-----------------------------------
Dreadnought
Sat Jan 12, 2013 3:47 pm

Re: Cannot Find Symbol (checked all obvious problems)
-----------------------------------
Do you understand why the following will not work?
[code]int x = 0;
while (x != 1) {
    int x = 1;
}[/code]

-----------------------------------
KingGrumpz
Sun Jan 13, 2013 10:00 am

Re: Cannot Find Symbol (checked all obvious problems)
-----------------------------------
I got fed up and just used a while(true), but thanks for the help.
