Questions tagged [cannot-find-symbol]

This tag is used when code returns an error message that a symbol cannot be located. These are usually compilation errors in Java.

This tag is used when code returns an error message that a symbol cannot be located. Such messages are usually associated with compilation errors in Java. See this post for a detailed description of causes and solutions: What does a "Cannot find symbol" compilation error mean?

251 questions
-3
votes
3 answers

Java: Cannot find symbol but typing is correct

I made a class Operator and a method called compare. However, when call this method in my program, I always got error message InfixToPostfix.java:17: error: cannot find symbol System.out.println(compare(op,op1)); …
-3
votes
3 answers

Java --- toUpperCase - cannot find symbol

I'm trying to convert one element from array to upper case, but I get an error "cannot find symbol". If I don't use "toUpperCase" it works just fine and the symbol "sentence" works too. Here's the part that doesnt work: if (i % 3==0){ …
-3
votes
2 answers

Java ArrayList names "Cannot Find Symbol" and "No Suitable Method" for PrintWriter

After looking around, I haven't been able to find either of these questions answered elsewhere. If they have been and I couldn't find them, please point me in the right direction. I use three ArrayLists in my program to store a customer's order…
David
  • 9
  • 5
-3
votes
2 answers

Collection.sort: 'cannot find symbol' despite giving right type, include, comperator

I'm getting a cannot find symbol error when I try to compile my code. I checked all the standard answers, there is a comperator implemented, I included the stuff I use, I am giving the function the right type. So what am I missing? Here is the…
-3
votes
1 answer

I'm having a few errors - Java program

This is really odd, I wrote a class for this program and was about to test how it reads data in from the file but I'm getting a "Cannot find symbol" error that refers to the "new" in the first scanner declared. The same error for the "=" in the…
-4
votes
1 answer

I got "error:cannot find symbol" for the JButton inside a frame outside of a JTabbedPane

So I have a frame, inside the frame there are tabs. I tried to put Jbutton outside of the tab but it wouldn't recognize my Jbutton. I keep on getting error: Cant find symbol. I don't understand why that happened. Would someone explain? import…
-4
votes
2 answers

I am new in java in my code here is an error "cannot find symbol "

I am following a Book in this book the code is given i tried to compile it but it shows errors here is the Code- class TapeDeck { boolean canRecord = false; void playTape() { System.out.println("tape recording"); } void…
user16674
  • 11
  • 4
-5
votes
1 answer

What is wrong with my code? I am a beginner and I keep getting this cannot find symbol error

I am unsure what to do from here. Please let me know what I am doing wrong and how I can fix it. Thank you. I have looked though many posts and anything I do just adds to the problem. Again, I have only been coding for a few days now. public…
Levi K
  • 573
  • 1
  • 4
  • 23
-5
votes
3 answers

Java Cannot find symbol

I am currently trying to write a programm that gets two variables and calculates them. The problem I am facing is that Java Editor shows me "cannot find symbol". public class neupqinputerror extends JFrame { public double haelfteP(double p){ …
Helena Ann
  • 21
  • 1
  • 6
-5
votes
1 answer

Java - Cannot find symbol...?

public class Temperatur{ public static void main(String[]args){ int[] temp = {0, 2, 2, 8, 12, 16, 21, 16, 21, 16, 12, 8, 4, 2}; method1(temp); } static int method1(int[] array){ int number= 0; for(int i=0;…
-7
votes
2 answers

could not find symbol thread.sleep

Why am I getting an error in this code please help me out. Error is coming that could not find symbol thread.sleep here is the code: import java.util.Date; class Date_Time { public static void main(String[] args) throws…
1 2 3
16
17