That'll be because d1 though d5 are locally scoped variables and don't exist outside the method they're declared in. You need to make them class variables.
d1 is defined locally in setlcddisplay() and so will not be available outside of that method. You need to define it as an instance variable to use it as you wish to.
Code:
class MyClass {
int myInstanceVariable;
void method1() {
myInstanceVariable = 10;
}
void method2() {
System.out.println(myInstanceVariable);
}
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.