Milestone 1 Quiz WTN

Milestone 1 Quiz WTN

University

10 Qs

quiz-placeholder

Similar activities

English for IT - Pretest

English for IT - Pretest

University

15 Qs

DSA Quiz 4 Set 1

DSA Quiz 4 Set 1

University

10 Qs

Blockchain Quiz

Blockchain Quiz

University

10 Qs

Java Collections

Java Collections

University

15 Qs

Java_Collection_I

Java_Collection_I

University

10 Qs

Archivos y Colecciones

Archivos y Colecciones

University

15 Qs

DBMS - Hash Indexing

DBMS - Hash Indexing

University

10 Qs

Hashing

Hashing

University

10 Qs

Milestone 1 Quiz WTN

Milestone 1 Quiz WTN

Assessment

Quiz

Computers

University

Hard

Created by

Prema,Asst.Prof, Chennai

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is not true about maps?

All keys in a map are unique

The return type of the values() method is a Collection

The Map interface extends the Collection interface

Elements of a LinkedHashMap are ordered by insertion order

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following program:

public class Demo{

public static void main(String args[]){

int variable1 = 10;

do{

if(variable1==10){

break;

}else{

variable1++;

System.out.println(variable1);

}

}while(variable1<10);

}

}

a. 10

b. 11

c. No Output

d. Compilation Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import java.util.*;

public class TestCollection {

    public static void main(String args[]) {

        Object al = new ArrayList();

        Object hs = new HashSet();

        Object hm = new HashMap();

        System.out.println(String.format("%s,%s,%s", al instanceof Collection, hs instanceof Collection, hm instanceof Collection));

    }

}What is the result of attempting to compile and run the program?

false,false,true

true,true,false

true,false,true

true,true,true

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following program:

public class Demo{

public static void main(String args[]){

int[] myArray = {1,2,3,4,5};

for(int counter:myArray){

System.out.println(++counter);

}

}

}

2

3

4

5

6

1

2

3

4

5

No Output

Compilation Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given classes A, B, and C, where B extends A, and C extends B, and where all classes implement the instance method void doIt(). How can the doIt() method in A be called from an instance method in C?

super.doIt()

super.super.doIt()

A.this.doIt()

It is not possible

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Using which one of the following keyword we can exclude some object properties from serialization process?

transient

exclude

omit

native

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is true?

Private methods of a superclass cannot be overridden n subclasses

A subclass can override any method present in a superclass

An overriding method can declare that it throws more exceptions than the method it is overriding

The parameter list of an overriding  method must be a subset of the parameter list of the method that it is overriding

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?