0

programming languages Online Quiz - 43

Description: programming languages Online Quiz - 43
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

: What will be the size of the @fields array? my $record = ':a:b:c:'; my @fields = split(':', $record, -1);

  1. 0

  2. 1

  3. 3

  4. 5


Correct Option: D
  1. 59

  2. Compile time error, because you have to do int total = ((Integer)(list.get(0))).intValue();

  3. Compile time error, because can't add primitive type in List.

  4. Compile Properly but Runtime Exception


Correct Option: A

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


Correct Option: A

What is the output for the below code ? public class C { } public class D extends C{ } public class A { public C getOBJ(){ System.out.println("class A - return C"); return new C(); } } public class B extends A{ public D getOBJ(){ System.out.println("class B - return D"); return new D(); } } public class Test { public static void main(String... args) { A a = new B(); a.getOBJ(); } }

  1. Compile with error - Not allowed to override the return type of a method with a subtype of the original type.

  2. class A - return C

  3. class B - return D

  4. Runtime Exception


Correct Option: C

What is the output for the below code ? public class Test { public static void main(String... args) { String input = "1 fish 2 fish red fish blue fish"; Scanner s = new Scanner(input).useDelimiter("\s*fish\s*"); System.out.println(s.nextInt()); System.out.println(s.nextInt()); System.out.println(s.next()); System.out.println(s.next()); s.close(); } }

  1. 1 2 red blue

  2. Compile Error - because Scanner is not defind in java.

  3. 1 fish 2 fish red fish blue fish

  4. 1 fish 2 fish red blue fish


Correct Option: A

What are the languages the flex can be developed?

  1. ActionScript

  2. MXML

  3. HTML

  4. None of the above


Correct Option: A,B
- Hide questions