0
What's the problem with this object?
7 Answers
+ 1
Forget declaring String name1, name2, ...; and after initialize
Try to declare like this
String name1 = "name1";
String name2 = "name2";
+ 1
Oh. a committed a mistake yeah you can do what you said. The problem was when you declared outside of method the method can't see the variables because it's outside scope. So you need to pass to method or declared as global or declare inside.
I was thinking was some weird sintax problem. But it's not.
0
It worked! But why?
Isn't it just the same declaring them and the initialize them?
0
And sorry for asking but just how much java experience do you have?
0
It also worked initializing them inside the method but I don't get why.
0
Strovosky not my strongest language but i always use in university