Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
interfaces
:
Content language: English
Русский
What happens after the following code is compiled and run: 01: interface TheInterface { 02: void print(); 03: } 04: 05: class TheClass implements TheInterface { 06: public void print() { 07: System.out.println("TheClass"); 08: } 09: } 10: 11: public class ClassConversion { 12: public static void main(String[] args) { 13: TheClass c = new TheClass(); 14: TheInterface i = c; 15: i.print(); 16: } 17: }
interfaces
What will happen as the result of the following code compilation? 1. package mail; 2. 3. interface Box { 4. protected void open(); 5. void close(); 6. public void empty(); 7. }
interfaces
Which definitions of the MyInterface interface are correct?
interfaces
What interfaces provide the ability to store objects as a "key-value" pairs?
interfaces
Which class that implements the interface AA and returns the amount of the return value of a() of two given classes is declared correctly: interface AA { int a(); } class A implements AA { public int a() { return 1; } } class B implements AA { public int a() { return 1; } }
interfaces
What happens during compiling and executing the code: public class GoTest { public static void main(String[] args) { Sente a = new Sente(); a.go(); Goban b = new Goban(); b.go(); Stone c = new Stone(); c.go(); } } class Sente implements Go { public void go() { System.out.println("go in Sente"); } } class Goban extends Sente { public void go() { System.out.println("go in Goban"); } } class Stone extends Goban implements Go { } interface Go { public void go(); }
interfaces
Given: interface Animal { void eat(); } // Insert code here public class HouseCat implements Feline { public void eat() { } } Which of the following lines will allow the code to compile successfully?
interfaces
Will this code compile? interface I1 {}; interface I2 extends I1{}; public class C implements I2, I1{}
interfaces
What will be the output of the following code? interface I_A { public void out1(); } interface I_B { public void out2(); } class Impl implements I_A, I_B { // 1 public void out2() { System.out.print("2"); } public void out1() { System.out.print("1"); } } public class Test { public static void main(String[] args) { Impl impl = new Impl(); I_A a; a = impl; a.out1(); ((I_B) a).out2(); // 2 } }
interfaces
Select all correct ways to extend following traits. trait QuizfulOne { var value: String } trait QuizfulTwo { def value: String }
interfaces
← Prev
1
2
Next →
Sign Up Now
or
Subscribe for future quizzes