programming languages Online Quiz - 24

programming languages Online Quiz - 24

20 Questions Published

Questions

Question 1 True/False

Can you inherit multiple interfaces?

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

What does the keyword virtual mean in the method definition?

  1. The method is public
  2. The method can be derived
  3. The method is static
  4. The method can be over-ridden
Question 3 Multiple Choice (Single Answer)

________________ refers to formatting data based on locale?

  1. Globalization
  2. Localization
  3. Impersonation
  4. Unicode program
Question 4 True/False

Is it possible to store multiple data types in System.Array?

  1. True
  2. False
Question 5 True/False

Do finally block get executed if the exception had not occurred?

  1. True
  2. False
Question 6 Multiple Choice (Single Answer)

Java allows multiple inheritance through

  1. Class
  2. Interface
  3. None
  4. Thread
Question 7 True/False

Parameter passing in java is pass by reference

  1. True
  2. False
Question 8 Multiple Choice (Single Answer)

static public class Test { public static void main(String[] args) { char c = 'a'; switch(c){ case 65: System.out.println("one");break; case 'a': System.out.println("two");break; case 3: System.out.println("three"); } } }

  1. one
  2. two
  3. Compile error - char can't be permitted in switch statement
  4. Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted
Question 9 Multiple Choice (Single Answer)

What is the output for the below code ? public class Test { public static void main(String... args) { ArrayList list = new ArrayList(); list.add(1); list.add(2); list.add(3); for(int i:list) System.out.println(i); } }

  1. 1 2 3
  2. Compile error , can't add primitive type in ArrayList
  3. Compile error on for(int i:list) , Incorrect Syntax
  4. 0 0 0
Question 10 Multiple Choice (Single Answer)

What is the result of executing the following code, using the parameters 0 and 3 ?public void divide(int a, int b) { try { int c = a / b; } catch (Exception e) { System.out.print("Exception "); } finally { System.out.println("Finally");}

  1. Prints out: Exception Finally
  2. Prints out: Finally
  3. Prints out: Exception
  4. Compile with error
Question 11 Multiple Choice (Multiple Answers)

Which of the below statement is true about Error?

  1. An Error is a subclass of Throwable
  2. An Error is a subclass of Exception
  3. Error indicates serious problems that a reasonable application should not try to catch.
  4. An Error is a subclass of IOException
Question 12 Multiple Choice (Single Answer)

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

  1. 0
  2. Compile with error
  3. null
  4. NullPointerException
Question 13 Multiple Choice (Single Answer)

Visual Basic is a

  1. Data Oriented Language
  2. Service Oriented Language
  3. Object Oriented Language
  4. Structured Oriented Language
Question 14 Multiple Choice (Single Answer)

Which keyword is used to prevent the values being changed?

  1. Static
  2. Const
  3. Preserve
  4. ReadOnly
Question 15 Multiple Choice (Single Answer)

Complete the code. Sub Demo() X = 4 Y = 5 Z = addNum(X,Y) Msgbox (Z) End Sub Function addNum(X,Y) Ans = X + Y <> End Function

  1. Return (Ans)
  2. Return Ans
  3. addNum = Ans
  4. addNum = Return Ans
Question 16 Multiple Choice (Single Answer)

Which window is used to show the values of variables that are in your code?

  1. Breakpoints
  2. Immediate window
  3. Properties window
  4. Watches window
Question 17 Multiple Choice (Single Answer)

What is the shortcut key to open the VB macro from excel?

  1. Alt + F11
  2. Alt + F10
  3. Ctrl + F10
  4. Alt + F8
Question 18 Multiple Choice (Single Answer)

1.Which tag is must for compilation of mxml file?

  1. Box
  2. Application
  3. Button
  4. Panel
Question 19 Multiple Choice (Single Answer)

2.Which two languages are used in Flex?

  1. Java & C
  2. mxml & as
  3. C & C
  4. java & javascript.
Question 20 Multiple Choice (Single Answer)

Can we create custom components ?

  1. Yes
  2. No
  3. Don't know
  4. No Idea