Description: programming languages Online Quiz - 139 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Class TestException 1. public class TestException extends Exception { 2. } Class A: 1. public class A { 2. 3. public String sayHello(String name) throws TestException { 4. 5. if(name == null) { 6. throw new TestException(); 7. } 8. 9. return “Hello “+ name; 10. } 11. 12. } A programmer wants to use this code in an application: 45. A a=new A(); 46. System.out.println(a.sayHello(”John”)); Which are true?
Given: class TestA { public void start() { System.out.println(”TestA”); } } public class TestB extends TestA { public void start() { System.out.println(”TestB”); } public static void main(String[] args) { ((TestA)new TestB()).start(); } } What is the result?
Given: 1. package sun.scjp; 2. public enum Color { RED, GREEN, BLUE } 1. package sun.beta; 2. // insert code here 3. public class Beta { 4. Color g = GREEN; 5. public static void main( String[] argv) 6. { System.out.println( GREEN); } 7. } The class Beta and the enum Color are in different packages. Which two code fragments, inserted individually at line 2 of the Beta declaration, will allow this code to compile?
Given: public class Pass { public static void main(String [] args) { int x 5; Pass p = new Pass(); p.doStuff(x); System.out.print(” main x = “+ x); } void doStuff(int x) { System.out.print(” doStuff x = “+ x++); } } What is the result?
Which JavaScript version was the first to allow image swapping, or image roll-overs?
Which of the following statements best describes the relationship between JavaScript and DHTML?
The JavaScript international standard is called
Which of the following browsers does not support JavaScript?
Which of the following browsers was the first to support JavaScript?
he original name of JavaScript was
When was the first release of a browser supporting JavaScript?
What are the purposes of comments in JavaScript code?
Which company first implemented the JavaScript language?
which of the following iterator must support *, ==, =- and ++ operations
which of the following is not an associative container
What is time complexity of Insertions or deletions at positions other than the end in "vector STL template class"
Which of the following is used for casting inherently incompatible pointers.
range_error is which type of exception.
Which of the following represents the correct syntax for re-throwing an exception.
What happen if the exception is not caught?