7. Which one statement below is true concerning the following code? 1. class Gre
ID: 3918410 • Letter: 7
Question
7. Which one statement below is true concerning the following code? 1. class Greebo extends java.util.Vector implements Runnable [ 2 4 6 public void run (String message) System.out.println("in run ) method: " + message); 9. class GreeboTest [ 10. public static vola main (String args! 12 13. 14. 15.1b 16. Greebo g - new Greebo (); Thread t-new Thread (g); t.start (); A) There will be a compiler error, because class Greebo does not correctly implement the Runnable interface. B) There will be a compiler error at line 13, because you cannot pass a parameter to the constructor of a Thread. C) The code will compile correctly but will crash with an exception at line 13. D) The code will compile correctly but will crash with an exception at line 14. E) The code will compile correctly and will execute without throwing any exceptionsExplanation / Answer
----------------------------------------------------------------------------------------------
The correct answer is A)
The run() method should be overriden. But in this case we are having a run(String message) method. There is no such run method in Runnable interface.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.