1. public interface Foo { int k = 4; / Line 3 / } Which three piece of codes are equivalent to line 3? final int k = 4; public int k = 4; static int k = 4; abstract int k = 4; volatile int k = 4; protected int k = 4;





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.26 am
    (1), (2) and (3) are correct. Interfaces can have constants, which are always implicitly public, static, and final. Interface constant declarations of public, static, and final are optional in any combination.
Show Similar Question And Answers
QA->.In the question below three words are given.They are followed by four words one of which stands for the class to which these three words belong.Identify that word:Barbarous,Crude,Rude....
QA->The electric charge built upon a material as a static mode?....
QA->What is the opposite of a static website?....
QA->Which is the deepest landlocked protected port?....
QA->Which is the deepest landlocked protected port ?....
MCQ->public interface Foo { int k = 4; / Line 3 / } Which three piece of codes are equivalent to line 3? final int k = 4; public int k = 4; static int k = 4; abstract int k = 4; volatile int k = 4; protected int k = 4;....
MCQ->Which two of the following are legal declarations for nonnested classes and interfaces? final abstract class Test {} public static interface Test {} final public class Test {} protected abstract class Test {} protected interface Test {} abstract public class Test {}....
MCQ->What will be the output of the program? public class Test { public static void main(String args[]) { class Foo { public int i = 3; } Object o = (Object)new Foo(); Foo foo = (Foo)o; System.out.println("i = " + foo.i); } }....
MCQ->What will be the output of the program? public class Test { public static int y; public static void foo(int x) { System.out.print("foo "); y = x; } public static int bar(int z) { System.out.print("bar "); return y = z; } public static void main(String [] args ) { int t = 0; assert t > 0 : bar(7); assert t > 1 : foo(8); / Line 18 / System.out.println("done "); } }....
MCQ->What will be the output of the program? public class Foo { Foo() { System.out.print("foo"); } class Bar { Bar() { System.out.print("bar"); } public void go() { System.out.print("hi"); } } / class Bar ends / public static void main (String [] args) { Foo f = new Foo(); f.makeBar(); } void makeBar() { (new Bar() {}).go(); } }/ class Foo ends /....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution