0
Java help
why i cant get any output? https://code.sololearn.com/cL9Z876X0Ik3/?ref=app
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;
}
}