#How do I fix undeclared variable error when I call method from another class?
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Would be nice if you provided your code to look at
The variable is likely private, package scoped. Either way you should be using a getter.
But please also share your code.
Please use this format for posting code:
```java
// Example java program
int value = 5;
System.out.println(value);
```
Which results in:
// Example java program
int value = 5;
System.out.println(value);
For syntax highlighting, you have to add the name of the language after the three backticks, like ```java. Please make sure to use exactly this format, so no space between the backticks and the language name, and a newline before the code starts. If done right, the syntax highlighting will even be applied to your text as you type, before sending.
simon_verhoeven • used /tag id: code
·