T
T
Timur2022-02-07 10:27:42
Java
Timur, 2022-02-07 10:27:42

What should I do if I get an error when trying to create a variable in Java?

I want to write a program for displaying variables on the screen, I create a variable with char and integer data types, and I get this error: The value of the local variable sym is not used.

6200c9ca5e29e437347251.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Michael, 2022-02-07
@Becoming_Java_Developer

This is not an error, but a warning.
IDE errors are usually underlined in red, warnings in yellow (at least in IDEA this is the case, the screenshot is similar to IDEA, but I'm not sure).
Actually the warning text also says that the variable is not used anywhere.
The warning has no effect on the compilation and operation of the program, its only purpose is to draw the programmer's attention to this code fragment in which he may have made a mistake (forgot to use a variable in the right place or forgot to remove a more unnecessary variable).
The warning will disappear when you finish the snippet.

P
prrrrrrr, 2022-02-07
@prrrrrrr

Again, sorry for the stupid questions, I'm just a Java beginner

First of all, you need to learn how to read errors

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question