Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Java concepts and its programming

What is the output for the below code ? public class Test{public static void main(String[] args){int i = 010; int j = 07;System.out.println(i); System.out.println(j); } } ?

What is the output for the below code ? public class Test{public static void main(String[] args){int i = 010; int j = 07;System.out.println(i); System.out.println(j); } } ?

A. 7 8
B. 8 7
C. 9 8
D. None

What is the output for the below code ? public class Test{public static void main(String[] args){int i = 010; int j = 07;System.out.println(i); System.out.println(j); } } ? Read More »

Java concepts and its programming

Suppose a class has public visibility. In this class we define a protected method. Which of the following statements is correct ?

Suppose a class has public visibility. In this class we define a protected method. Which of the following statements is correct ?

A. From within protected methods you do not have access to public methods.
B. This method is only accessible from inside the class itself and from inside all subclasses.
C. In a class, you cannot declare methods with a lower visibility than the visibility of the class in which it is defined.
D. This method is accessible from within the class itself and from within all classes defined in the same package as the class itself.

Suppose a class has public visibility. In this class we define a protected method. Which of the following statements is correct ? Read More »

Java concepts and its programming