programming languages Online Quiz - 103
Description: programming languages Online Quiz - 103 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
A static method can refer to any instance variable of the class.
Java runs on
An applet will run in almost any browser because
What is an Applet?
What is Java?
The BorderLayout class provides static fields for
What is the advantage of using import statements?
Which of the following statements about this code are true? class A extends Thread{ public void run(){ for(int i =0; i < 2; i++){ System.out.println(i); } } } public class Test{ public static void main(String argv[]){ Test t = new Test(); t.check(new A(){}); } public void check(A a){ a.start(); } }
What is the output for the below code ? class A implements Runnable{ public void run(){ System.out.println("run-a"); } } 1. public class Test { 2. public static void main(String... args) { 3. A a = new A(); 4. Thread t = new Thread(a); 5. t.start(); 6. t.start(); 7. } 8. }
What is the output for the below code ? public class Test { public static void main(String... args) { int a =5 , b=6, c =7; System.out.println("Value is "+ b +c); System.out.println(a + b +c); System.out.println("String "+(b+c)); } }
What is the output for the below code ? 1. public class A { 2. int add(int i, int j){ 3. return i+j; 4. } 5.} 6.public class B extends A{ 7. public static void main(String argv[]){ 8. short s = 9; 9. System.out.println(add(s,6)); 10. } 11.}
What is the output for the below code ? 1. public class Test { 2. public static void main(String[] args){ 3. int i = 010; 4. int j = 07; 5. System.out.println(i); 6. System.out.println(j); 7. } 8. }
Select correct answers
Which of the following are reserved keywords in Java?
How restrictive is the default accessibility compared to public, protected, and private accessibility in Java?
Which of these are valid declarations of the main() method in order to start the execution of a Java application?
In derived classes, in what order are the constructors called?
Select correct answers
What will be the result of attempting to compile this Java class?
If an exception is not caught, the finally block will run