0

programming languages Online Quiz - 83

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

What will be the output ? package A; sub new { my $class = shift; return bless {}, $class; } package B; use base 'A'; sub foo { return 'blah'; } package main; my $obj = B->new(); print $obj->foo(), "\n";

  1. blah

  2. Empty String

  3. Can't locate object method "new" via package "B"

  4. None of the above


Correct Option: A
  1. my $statement = $dbh->execute("INSERT INTO names VALUES ('John')");

  2. my $statement = $dbh->run("INSERT INTO names VALUES ('John')");

  3. my $statement = $dbh->prepare("INSERT INTO names VALUES ('John')"); $statement->execute;

  4. my $statement = $dbh->sql("INSERT INTO names VALUES ('John')"); $statement->execute;


Correct Option: C
  1. any number of any characters

  2. any number of any characters surrounded by Q and E

  3. literally \Q.*\E

  4. literally .*


Correct Option: D

Select the events available for a gridview/datagrid

  1. RowDataBound

  2. ItemDataBound

  3. RowClick

  4. ItemClick


Correct Option: A,B

what are the namespace/classes related Database operation?

  1. System.Data

  2. System.Data.Dataset

  3. System.Data.SQLClient

  4. System.Data.Datareader


Correct Option: A,C

The different types of assemblies are private, public, shared, unshared, satellite.

  1. True

  2. False


Correct Option: B
  1. Compilation error

  2. Runtime error

  3. No errors

  4. Compilation error at statement 2


Correct Option: C

Following code will result in: class A { int b = 1; public static void main(String [] args) { System.out.println("b is " + b); }}

  1. Compilation error

  2. Runtime Error

  3. Runtime Exception

  4. Output of b is 1


Correct Option: A

Following code will result in: class A { public static void main(String [] args) {B b = new A(); }} class B extends A {}

  1. Compile error

  2. Runtime Exception

  3. No error

  4. Compile error. Type mismatch: cannot convert from A to B


Correct Option: D

Integer a = new Integer(2); Integer b = new Integer(2); What happens when you do if (a==b)?

  1. Compiler error

  2. Runtime Exception

  3. True

  4. False


Correct Option: D
- Hide questions