HiTech Quiz 5

HiTech Quiz 5

Professional Development

8 Qs

quiz-placeholder

Similar activities

6. Method

6. Method

Professional Development

10 Qs

2.13.2022 | Introduction to Java Review

2.13.2022 | Introduction to Java Review

Professional Development

8 Qs

Quiz Java héritage

Quiz Java héritage

Professional Development

10 Qs

Java Programming RBVRRIT

Java Programming RBVRRIT

University - Professional Development

10 Qs

Mech 3

Mech 3

Professional Development

10 Qs

Java Programming Quiz #1

Java Programming Quiz #1

Professional Development

10 Qs

JAVA QUIZ

JAVA QUIZ

Professional Development

11 Qs

Java Fundamentals

Java Fundamentals

Professional Development

11 Qs

HiTech Quiz 5

HiTech Quiz 5

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Venkatesh iGen

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

_________________ is a collection of elements used to store the same type of data.
Array
Switch
Case
Loop

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public class Test {

public static void main(String[] args) {

for (int i = 0; i < 5; i++) {

if (i == 3) break;

System.out.print(i + " ");

}

}

}

0 1 2 3 4

0 1 2 3

0 1 2

Compilation Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public class Test {

public static void main(String[] args) {

for (int i = 0; i < 5; i++) {

if (i == 2) continue;

System.out.print(i + " ");

}

}

}

0 1 2 3 4

0 1 3 4

1 2 3 4

0 1 3

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public class Test {

public static void main(String[] args) {

int i = 0, j = 0;

while (i < 3) {

while (j < 3) {

System.out.print(i + "" + j + " ");

j++;

}

i++;

}

}

}

00 01 02 10 11 12 20 21 22

00 01 02

Infinite loop

Compilation error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public class Test {

    public static void main(String[] args) {

        for (int i = 0; i < 3; i++) {

            for (int j = 0; j < 3; j++) {

                if (i == j) continue;

                System.out.print(i + "" + j + " ");

            }

        }

    }

}


01 02 10 12 20 21

00 01 02 10 11 12 20 21 22

00 11 22

01 02 10 12 20 21 22

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this Java program?


public class Test {

    public static void main(String[] args) {

        int i = 1;

        while (i <= 5) {

            System.out.print(i + " ");

            i += 2;

        }

    }

}


 1 2 3 4 5

Compilation Error

 1 3 5 7

1 3 5

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following Java code?


public class Test {

    public static void main(String[] args) {

        String str = "12345";

        int sum = 0;

        for (int i = 0; i < str.length(); i++) {

            sum += str.charAt(i) - '0';

        }

        System.out.println(sum);

    }

}


10

12345

Compilation Error

15

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this Java program?


public class Test {

    public static void main(String[] args) {

        for (int i = 0; i < 3; i++) {

            for (int j = 0; j < 3; j++) {

                if (i + j > 3) break;

                System.out.print(i + "" + j + " ");

            }

        }

    }

}


00 01 02 10 11 12 20 21 22

00 01 02 10 11 20 21

00 01 02 10 11 12 20

00 01 02 10 11