{"id":3698,"date":"2016-05-15T22:41:07","date_gmt":"2016-05-15T16:41:07","guid":{"rendered":"https:\/\/mcqacademy.com\/en\/mcq\/which-method-must-be-defined-by-a-class-implementing-the-java-lang-runnable-interface\/"},"modified":"2016-05-15T22:41:07","modified_gmt":"2016-05-15T16:41:07","slug":"which-method-must-be-defined-by-a-class-implementing-the-java-lang-runnable-interface","status":"publish","type":"mcq","link":"https:\/\/mcqacademy.com\/en\/mcq\/which-method-must-be-defined-by-a-class-implementing-the-java-lang-runnable-interface\/","title":{"rendered":"Which method must be defined by a class implementing the java.lang.Runnable interface?"},"content":{"rendered":"","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","topic":[107],"subject":[16],"class_list":["post-3698","mcq","type-mcq","status-publish","hentry","topic-threads","subject-java-programming"],"mcq_note":"<strong>Option B is correct<\/strong> - because in an interface all methods are abstract by default therefore they must be overridden by the implementing class. The Runnable interface only contains 1 method, the <code>void run()<\/code> method therefore it must be implemented.\r\n\r\n<strong>Option A and D are incorrect<\/strong> because they are narrowing the access privileges i.e. package(default) access is narrower than public access.\r\n\r\n<strong>Option C is incorrect<\/strong>\u00a0because <code>start()<\/code>\u00a0is not method in the Runnable interface therefore it is incorrect.","mcq_options":[{"right":"no","answer":"<code>void run()<\/code>"},{"right":"yes","answer":"<code>public void run()<\/code>"},{"right":"no","answer":"<code>public void start()<\/code>"},{"right":"no","answer":"<code>void run(int priority)<\/code>"}],"multi_answers":"no","subject_terms":[{"id":16,"title":"Java Programming","slug":"java-programming"}],"topic_terms":[{"id":107,"title":"Threads","slug":"threads"}],"_links":{"self":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/mcq\/3698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/mcq"}],"about":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/types\/mcq"}],"author":[{"embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/comments?post=3698"}],"wp:attachment":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/media?parent=3698"}],"wp:term":[{"taxonomy":"topic","embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/topic?post=3698"},{"taxonomy":"subject","embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/subject?post=3698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}