wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SENZ AIOT SAVANTS - JV & JS

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

What is the output of the following Java code snippet?

a)

5, 5

b)

5, 10

c)

10, 5

d)

10, 10

2.

What is the difference between "==" and ".equals()" in Java?

a)

There is no difference - they both compare the contents of two objects

b)

".equals()" compares object references, while "==" compares the contents of the objects.

c)

"==" compares object references, while ".equals()" compares the contents of the objects.

d)

None of the above.

3.

What is the output of the following Java code snippet?

a)

a = 10, b = 15

b)

a = 5, b = 10

c)

a = 15, b = 5

d)

a = 10, b = 5

4.

What is the difference between an abstract class and an interface in Java?

a)

An abstract class can be extended by multiple classes, while an interface can only be implemented by a single class.

b)

An abstract class can have method implementations, while an interface cannot.

c)

An interface can have method implementations, while an abstract class cannot.

d)

An interface can be extended by multiple interfaces, while an abstract class can only be extended by a single class.

5.

What is the output of the following JavaScript code?

a)

10

b)

20

c)

undefined

d)

ReferenceError

6.

What is the purpose of the "useEffect" hook in React?

a)

It is used to manage the component's state

b)

It is used to fetch data from an API

c)

It is used to perform side effects within a component

d)

It is used to render the component to the DOM

7.

What is the output of the following React code?

a)

The code will not work because the function is not written properly.

b)

The code will render a button with the text "Click me" on the page.

c)

The code will render a button with the text "Click me" on the page and log "Button clicked!" to the console when the button is clicked.

d)

The code will render a button with the text "Button clicked!" on the page when the button is clicked.

8.

Which of the following is a valid way to declare a function in JavaScript?

a)

function myFunction = () => {}

b)

let myFunction = function() {}

c)

const myFunction() => {}

d)

myFunction: function() {}

9.

Which of the following data structures is based suited to implement a priority queue?

a)

Array

b)

Stack

c)

Binary Heap

d)

Queue

10.

Which of the following data structures is best suited for implementing a LIFO stack?

a)

Linked list

b)

Queue

c)

Array

d)

Tree