0

programming languages Online Quiz - 9

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

Which is true about an anonymous inner class?

  1. It can extend exactly one class and implement exactly one interface.

  2. It can extend exactly one class and can implement multiple interfaces.

  3. It can extend exactly one class or implement exactly one interface.

  4. It can implement multiple interfaces regardless of whether it also extends a class.


Correct Option: C
class Boo {
    Boo(String s) {}
    Boo() {}
}
class Bar extends Boo {
    Bar() {}
    Bar(String s) {
        super(s);
    }
    void zoo() { 
         // insert code here      
    }  
}

which one create an anonymous inner class from within class Bar?

  1. Boo f = new Boo(24) { };

  2. Boo f = new Bar() { };

  3. Bar f = new Boo(String s) { };

  4. Boo f = new Boo.Bar(String s) { };


Correct Option: B

Which is true about a method-local inner class?

  1. It must be marked final.

  2. It can be marked abstract.

  3. It can be marked public.

  4. It can be marked static.


Correct Option: B

Which constructs an anonymous inner class instance?

  1. Runnable r = new Runnable() { };

  2. Runnable r = new Runnable(public void run() { });

  3. Runnable r = new Runnable { public void run(){}};

  4. System.out.println(new Runnable() {public void run() { }});


Correct Option: D
  1. MyOuter.MyInner m = new MyOuter.MyInner();

  2. MyOuter.MyInner mi = new MyInner();

  3. MyOuter m = new MyOuter(); MyOuter.MyInner mi = m.new MyOuter.MyInner();

  4. MyInner mi = new MyOuter.MyInner();


Correct Option: A

Which of these is /are SYNON relations?

  1. defined as

  2. refers

  3. owned by

  4. defined by

  5. includes

  6. has


Correct Option: A,C,E,F
  1. known as

  2. has

  3. qualified by

  4. includes

  5. refers to

  6. qualified as


Correct Option: A,D,E,F

Which is not a file to file relation

  1. defined as

  2. refers

  3. owned by

  4. includes

  5. extended by

  6. known by


Correct Option: B,F

Which is a non-keyed access path

  1. Physical

  2. Update

  3. Resequence

  4. Retrieval

  5. Span

  6. Query


Correct Option: A

What is the output of the below JavaScript?


alert(parseInt("8.56") + " " + parseInt("8error"));     
  1. Error

  2. 98

  3. 88

  4. 16


Correct Option: C

What is the output of the below JavaScript?
alert(parseFloat("8.56"));

  1. 8.56

  2. 9

  3. error

  4. NaN


Correct Option: A

What is the output of the below JavaScript?


    var currDate = new Date("30 September, 2011");
    alert(currDate.getMonth());
  1. 9

  2. 8

  3. 10

  4. error


Correct Option: B

function Book(id, name) {
    this.id = id;
    this.name = name;
}
var book = new Book("1001", "Head First JavaScript");
alert(book.id);
  1. 1001

  2. error

  3. Head First JavaScript

  4. id


Correct Option: A

a = 10;         
var b = 20;         
var c = a + b;          
alert(c);   
  1. error

  2. 1020

  3. 30

  4. 20


Correct Option: C

var personObj = new Object();       
personObj.firstname = "Jerome";         
personObj.lastname = "Davin";       
alert(personObj.firstname);     
  1. Jerome

  2. Davin

  3. error

  4. firstname


Correct Option: A

What is the output of the below JavaScript?


var personObj = {firstname:"Jerome",lastname:"Davin"};          
alert(personObj.lastname);      
  1. Davin

  2. Jerome

  3. error

  4. lastname


Correct Option: A
- Hide questions