Question 1 Correct Mark 1.00 out of 1.00 Flag question Question text ___ and _____ are the access specifiers that can be applied to top level Class. Select one or more: public protected default private Feedback Your answer is correct. The correct answers are: default, public Question 2 Correct Mark 1.00 out of 1.00 Flag question Question text class Sample{ private double num = 100; private int square(int a){ return a*a; } } public class Test{ public static void main(String args[]){ Sample obj = new Sample(); System.out.println(obj.num); System.out.println(obj.square(10)); } } Select one: Compile time error Run time error Executes but no output 100 Feedback Your answer is correct. The correct answer is: Compile time error Question 3 Correct Mark 1.00 out of 1.00 Flag question Question text Choose the appropriate access specifier for the attribute value so that it can be accessed from anywhere. class Test { Choose... private protected public d
The Immortal Knowledge
Comments
Post a Comment