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?

220 questions
-2
votes
3 answers

Stuck with this programming question for school

I'm writing a simple Java program for school. I can't seem to understand why I am getting Error: Cannot Find Symbol . Here's the whole code with the error at the bottom. (Click image to enlarge)
-2
votes
3 answers

Compiling problem - Why doesn't Int work on my age variable?

Picture of error First program I make after hello world. Firstname, lastname and age. When using String on age, everything works as expected. I was told to use Int on age instead of String, but when I changed to Int and try to compile, I get this…
Deemahom
  • 1
  • 1
-2
votes
1 answer

Cannot find symbol symbol:method JOptionPane mutliple buttons

package thearena; import javax.swing.JOptionPane; import java.util.Random; public class Arena { public static void main(String[] args) { Object[] loading_choices = {"Yes","No"}; int action =…
-2
votes
1 answer

assign decimal value to a string in java

I am working on a GPA calculator where a user can enter in letter values such as A, B+, D- and so on but i am having trouble assigning the decimal values to the letter grade. I feel like i am not writing my code correctly. I am using an if-else…
dbhuller
  • 11
  • 3
-2
votes
5 answers

How come this string cannot be resolved?

This code is part of a context menu that pops up when a listview is clicked. I am trying to get the user result through whether or not a CheckBox is checked or not. The problem is that the string I am creating cannot be resolved. Here is the…
Abe
  • 153
  • 1
  • 8
-2
votes
6 answers

What's wrong with the following code in java

I am new to exception handling in java. I was just trying to clear my concepts,but i encountered the following problem. Here is the code. class Inn { public static void main(String... args) { try{ String i="Asd"; }…
asad
  • 7
  • 4
-2
votes
1 answer

Compilation error "cannot find symbol"

I am trying to insert data into MySQL and I'm getting an error: cannot find symbol c import java.sql.*; class Insert{ public static void main(String args[]){ try{ Class.forName("com.jdbc.mysql.Driver"); …
-2
votes
2 answers

Java :"error: cannot find symbol"

i'm a new to java and just bought this amazing book to start learning with. One of the exercises, it asked me to do this ( it's exactly like in the book ) : class SimpleDotComTestDrive { public static void main (String[] args) { …
-2
votes
1 answer

Maven & InventoryClickEvent.getClickedInventory();

Whilst coding a fun new trash can for a Minecraft server network that I develop for, I came across a pretty strange, and therefore infuriating, bug concerning Maven. I've been using it for a year or two now and have only gotten a single build error…
Incomp
  • 63
  • 2
  • 7
-3
votes
1 answer

Java: "cannot find symbol" of a return value

I cannot get this variable returned. I am a real beginner with Java and I wanted to experiment with my new learned knowlegde. The goal of this method is to create a random name generator which can be expanded as I see fit. And it works, but it does…
GalliadII
  • 1
  • 1
-3
votes
3 answers

How can I solve the cannot find symbol error in the isWon() & isFull() in my Tic Tac Toe program?

I am trying to compile this tic tac toe program but I keep getting cannot find symbol errors from the isWon() & isFull(). This is the class which contains the isWon() & isFull() import java.awt.*; import java.awt.event.*; import…
-3
votes
4 answers

error: cannot find symbol superclass and subclass

I am a beginner in java and I am trying to write a java code where the program has to calculate the arithmetic mean in the superclass and standard deviation in the subclass. Here is my code: import java.util.*; class ArithmeticMean { double …
Abhishek Diwakar
  • 436
  • 1
  • 6
  • 16
-3
votes
1 answer

How do I get rid of the "Cannot resolve symbol R" error?

First of all sorry for any fustration, im a newbie at coding for android. I came home trying to carry on with my application (which worked fine the last I tested it) and I got this error when I opened up android studio: Cannot resolve symbol R This…
-3
votes
2 answers

java cannot find symbol variable super

hello i'm super stuck and cannot work out why this is not working. i'm trying to use inheritance and override but i keep getting this error. Been trying to figure this out for the past hour but have had no clue. i'm probably missing something silly,…
-3
votes
1 answer

Why do I get a 'cannot find symbol' error in this program?

When I run the following program, I get a 'cannot find symbol' error. It is probably caused by a stupid mistake, but I have spent about an hour trying to fix it and I have no idea what the problem is. Here is the code: import java.util.*; public…
wes1099
  • 98
  • 7
1 2 3
14
15