0
Alien head

programming languages Online Quiz - 9

Description: programming languages Online Quiz - 9
Number of Questions: 20
Created by:
Tags: programming languages

What is the output of the below JavaScript?

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

  2. Jerome

  3. error

  4. lastname

Answer: 1
<script>        
var personObj = new Object();       
personObj.firstname = "Jerome";         
personObj.lastname = "Davin";       
alert(personObj.firstname);     
</script>
  1. Jerome

  2. Davin

  3. error

  4. firstname

Answer: 1
<script>        
a = 10;         
var b = 20;         
var c = a + b;          
alert(c);   
</script>
  1. error

  2. 1020

  3. 30

  4. 20

Answer: 3

What is the output of the below JavaScript?

<script>        
var book = "Head First JavaScript";         
alert(book.length);     
</script>
  1. 21

  2. 20

  3. 22

  4. error

Answer: 1
<script>        
function Book(id, name) {
    this.id = id;
    this.name = name;
}
var book = new Book("1001", "Head First JavaScript");
alert(book.id);
</script>
  1. 1001

  2. error

  3. Head First JavaScript

  4. id

Answer: 1

What is the output of the below JavaScript?

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

  2. 8

  3. 10

  4. error

Answer: 2

What is the output of the below JavaScript?

alert(parseFloat("8.56"));

  1. 8.56

  2. 9

  3. error

  4. NaN

Answer: 1

What is the output of the below JavaScript?

<script>        
alert(parseInt("8.56") + " " + parseInt("8error"));     
</script>
  1. Error

  2. 98

  3. 88

  4. 16

Answer: 3

What is the output of the below JavaScript?

<script>        
with(Math){               
     alert(pow(2,3));       
}   
</script>
  1. 8

  2. 9

  3. error

  4. 6

Answer: 1

What is the output of the below JavaScript?

alert(Math.sqrt(-16));

  1. -4

  2. 4

  3. Error

  4. NaN

Answer: 4

How many types of access paths are there in SYNON

  1. 6

  2. 5

  3. 7

  4. 8

  5. 4

  6. 9

Answer: 1

Which is a non-keyed access path

  1. Physical

  2. Update

  3. Resequence

  4. Retrieval

  5. Span

  6. Query

Answer: 1

Which is not a file to file relation

  1. defined as

  2. refers

  3. owned by

  4. includes

  5. extended by

  6. known by

Answer: 2,6

Which is not a file to field relation

  1. known as

  2. has

  3. qualified by

  4. includes

  5. refers to

  6. qualified as

Answer: 1,4,5,6

Which of these is /are SYNON relations?

  1. defined as

  2. refers

  3. owned by

  4. defined by

  5. includes

  6. has

Answer: 1,3,5,6
public class MyOuter {
    public static class MyInner {
        public static void foo() {}
    }
}

which statement, if placed in a class other than MyOuter or MyInner, instantiates an instance of the nested class?

  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();

Answer: 1

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() { }});

Answer: 4

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.

Answer: 2
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) { };

Answer: 2

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.

Answer: 3
+ View questions