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
1
vote
2 answers

Java - Cannot Find Symbol Error With Other Classes

First and foremost I want to make myself clear: I am not asking what the cannot find symbol error means, I am simply asking what is causing this error in this context. I have recently delved into classes in Java. Below is my first [non main]…
Domani Tomlindo
  • 239
  • 1
  • 5
  • 12
1
vote
1 answer

android studio cannot find a parameter

I have an Android app that uses Firebase and I am having an error with a query. In my class file I am defining the search and I am getting: error: cannot find symbol variable query Here is the code from my class file: public class SearchFragment…
1
vote
1 answer

Android build failed: error: cannot find symbol variable radio_animator

I just upgraded Android studio to the latest version : Android Studio 3.2.1 Build #AI-181.5540.7.32.5056338, built on October 9, 2018 JRE: 1.8.0_152-release-1136-b06 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10…
1
vote
3 answers

Cannot find symbol - class InventoryItem

I re-type these code from a book and somehow I got error " Cannot find symbol - class InventoryItem " import java.util.Scanner; public class ReturnObject { public static void main(String[] args) { InventoryItem item; item =…
Đức Seven
  • 57
  • 1
  • 5
1
vote
1 answer

Why do I get a 'cannot find symbol class' error on my Android import statement (ActionBarActivity) after updating appcompat to 27.1?

Why do I get a 'cannot find symbol class' error on my Android import statement (ActionBarActivity) after updating appcompat to 27.1? I am getting the following error, on the following import statement. Notice the import statement is now greyed…
1
vote
1 answer

how to make a true boolean into a variable

(amateur highs chool Java coder here). Iv'e been working on this project, and Iv'e reached a problem I can't figure out. Here's what I need help with: (I'm trying to write a program that will determine if the driver is speeding, and if so which one…
H. Woolverton
  • 31
  • 1
  • 7
1
vote
2 answers

formatting JTextfields using another class

this is the code of the Gui Design class and below is the Class that provides functionality to the program. Im trying to get user input from the textfields so i can remove the text using the clearAll method and also save user input using the saveit…
1
vote
0 answers

java “cannot find symbol” - when importing from a library

So I have a java project (P1) (I am using Play Framework) in which I import a jar file (I generated from a different project I have (P2) ). I had to do few changes in project (P2) including renaming few variables. Then I regenerated the Jar file…
1
vote
2 answers

Error: cannot find symbol - method liesInt()

The task is to "change" the following program so that it is possible to create a subclass which enables the user to enter the numbers over Scanner: public class Patrick3 { static public void main(String[] emil) throws java.io.IOException { …
Phoney
  • 21
  • 3
1
vote
1 answer

ArrayList error - Cannot find symbol

I'm working on a final project for school and having some troubles. I have never done any programming in Java or really anything Object Oriented, so my code's likely not going to be that great. I'm having some issues with my array list. I am getting…
gmart
  • 23
  • 1
  • 3
1
vote
2 answers

Java - pass object as parameter in constructor

My gaol is to use an instance of a class as parameter for another class. I will describe my problem with an example. public class Color { public String color; public Color (String color) { this.color = color; } public Color…
Paul Ahuevo
  • 131
  • 1
  • 2
  • 13
1
vote
2 answers

Java error when passing arrays from other methods

I'm making a short quiz game where the user inputs their answers that are then stored into an array which is compared to an array containing the correct answers. I have two errors when I try and compile the code: Cannot find symbol: variable tar and…
1
vote
2 answers

ArrayList cannot find symbol

import java.util.*; public class GameMain{ public static void main(String [] args){ Scanner scan = new Scanner(System.in); Random rand = new Random(); Enemy e1 = new Knight(); Enemy e2 = new Skeleton(); Enemy e3 =…
1
vote
2 answers

Cannot find Collections.sort despite Comparable being implemented

I read through other questions here and found that when the compiler throws a Cannot find symbol for Collections.sort(List list) the problem was most often either... It was not passed a List List doesn't implement Comparable Importation of…
Legion Daeth
  • 329
  • 1
  • 5
  • 15
1
vote
0 answers

i can normally compile the file but when i run javac on it i get "cannot find symbol". What am i missing?

i am trying to create and object ExerciseLib with the following java code, and then call a method on the object to print a list: ExerciseLib entry = new…
1 2
3
16 17