'Error in java when adding attributes and trying to insert code with right click
I need to make a java program for my master. we have been taught very little but they already gave us an assignment. in this assignment I need to make a list of students
i started with a class to create the attributes for each student and made a constructor. I need to add now setters and getters but I hear the 'error' sound and nothing happens when i do right click and choose insert code.
The only error I have is that when i added the attributes i got an error that variables are never read. I did the steps exactly as my teacher has them in his project. when i clicked on that error i had 2 options. one to untick the unused option ( which i did -not sure though if correct, but i don't know how to reverse) or to make the variable final, but i need to edit so i cannot have them final..
Is it possible that this error is the one not allowing me to proceed by adding setters and getters? enter image description here
Solution 1:[1]
seems its resolved. i added manually the first getter setter and then i was able to add the rest with right click insert code. moreover now the initial error disappeared.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | dora tzm |
