24th Oct 2017, 7:14 AM
oyl
1 Answer
+ 5
class Program { public static void main(String[] args) { // Need to have x here, otherwise invalid identifier int x = Pokemon.dog(); System.out.println(x); } } class Pokemon{ static int dog() { int x=10; // x here is unknown to main() need to return it to main return x; // or, simply return 10; } }
24th Oct 2017, 7:45 AM
Ipang