What is the result?

Given:

What is the result?

Given:

What is the result?

A.
Daniel

B.
Unknown

C.
It may print”unknown”or”Daniel”depending on the JVM implementation.

D.
Compilation fails.

E.
An exception is thrown at runtime.

Explanation:

The compilation fails at line start();
Erstellen eines statischen Verweises auf die nicht statische Methode start() vom Typ Runner nicht
möglich.Exception in thread “main” java.lang.RuntimeException: Uncompilable source code – nonstatic method start()cannot be referenced from a static context



Leave a Reply 1

Your email address will not be published. Required fields are marked *