Question: Given: class JavaStaticExample { static int i = 10; static void method() { System.out.println(abc); } public static void main(String[] args) { JavaStaticExample.method(); // statement X
Given:
class JavaStaticExample {
static int i = 10;
static void method() {
System.out.println("abc");
}
public static void main(String[] args) {
JavaStaticExample.method(); // statement X
System.out.println(JavaStaticExample.i); // statement Y
}
}
(a) Write another way to call the static method other than the one shown in statement X.
(b) Write another way to call the static method other than the one shown in statement Y.
oop java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
