programming languages Online Quiz - 214
Description: programming languages Online Quiz - 214 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Who can access a method if it is marked as protected internal ?
Output of this program : class type { int num=12; void setnum(int num){ num=num; } int getnum() { return num; } public static void main(String[] args){ type obj=new type(); obj.setnum(10); System.out.print(obj.getnum()); } }
Correct way of method declaration within interface :
Which program will give correct output :
Output of this program : class type { int num=12; void setnum(int num){ num=num; } int getnum() { return num; } public static void main(String[] args){ type obj=new type(); obj.setnum(10); System.out.print(obj.getnum()); } }
Which program will give correct output :
What will be output for the following program? public class Boxing2 { public static void main(String[] args) { byte b = 10; method(b); } static void method(int i){ System.out.println("Primitivae Type call"); } static void method(Integer i){ System.out.println("Wrapper Type Call"); } }
What will be the output of the following program? public class Ques09 { public static void main(String[] args) { Integer a = null; a = new Integer(10); int b = 20; a = b; a = 30; System.out.println(a++); short s = 100; a = s; System.out.println(a--); } }