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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!