programming languages Online Quiz - 182
Description: programming languages Online Quiz - 182 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
What is the output of the following code snippet ?? void main() { int a = (2,4); printf("%d", a); }
What is the output of following code snippet ? void main() { printf(printf("anna")); }
Which of the access modifiers a top level class may have?
Given a one dimensional array arr, what is the correct way of getting the number of elements in arr.
Which of the following are keywords in Java?
What gets printed when the following program is compiled and run? class test { public static void main(String args[]) { int i,j,k,l=0; k = l++; j = ++k; i = j++; System.out.println(i); } }
What gets printed when the following program is compiled and run. protected class example {public static void main(String args[]) {String test = "abc";test = test + test;System.out.println(test);}}
What gets printed when the following program is compiled and run. Select the one correct answer class B { public static void main(String[] args) { int a=10; if(a=10) System.out.println("tomcat"); else System.out.println("root"); } }
package inheritance; class TestInheritance1 { public int empId =100; public String name ="tcs" ; } package inheritance1; import inheritance.TestInheritance1; public class TestInheritance_1 extends TestInheritance1 { public static void main(String[] args) { System.out.println("EmpId is "+empId); } }
package inheritance; class TestInheritance4 { String name ="TCS"; } package inheritance1; import inheritance.TestInheritance4; public class TestInheritance_4 extends TestInheritance4 { void printName() { System.out.println("name ="+name); } public static void main(String[] args) { TestInheritance_4 T_4 = new TestInheritance_4(); T_4.printName(); } }
package inheritance; public class TestInheritance7{ protected int p = 100; } package inheritance1; import inheritance.TestInheritance7; public class TestInheritance_7 extends TestInheritance7{ void printP() { TestInheritance7 T7 = new TestInheritance7(); System.out.println("p = "+T7.p); } public static void main(String[] args) { TestInheritance_7 T_7 = new TestInheritance_7(); T_7.printP(); } }
package inheritance;
class TestInheritance4 {
String name = "JAVA";
}
package inheritance1;
import
import inheritance.TestInheritance4;
public class TestInheritance_4 extends TestInheritance4 {
void printName() {
System.out.println("name =" + name);
}
public static void main(String[] args) {
TestInheritance_4 T_4 = new TestInheritance_4();
T_4.printName();
}
}