Search Header Logo

Java Quizz

Authored by Peruvayila Vikram

Other

University

Used 2+ times

Java Quizz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How do we access data in an array

using operator

using variable

using index

using pointer

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the output of the following java program
class Demo
{
public static void main(String args[])
{
int a[] = new int[3];
System.out.println("a[0] is "+a[0]);
}
}

compilation error

runtime error

0

1

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is the correct way of importing an entire package ‘pkg’?

import pkg.

Import pkg.

import pkg.*

Import pkg.*

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following package stores all the standard java classes?

lang

java

util

java.packages

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the output of the following program

import java.util.*;
class Launch {
public static void main(String args[]) {
int array[] = new int [5];
for (int i = 5; i > 0; i--) {
array[5 - i] = i;
}
Arrays.sort(array);
System.out.print(Arrays.binarySearch(array, 4));
}
}

2

3

4

5

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?