JavaDemo1

JavaDemo1

Professional Development

15 Qs

quiz-placeholder

Similar activities

Java Basics

Java Basics

Professional Development

17 Qs

Exception Handling-1

Exception Handling-1

Professional Development

10 Qs

kisi kisi 49-60

kisi kisi 49-60

Professional Development

15 Qs

AD_Java Basics

AD_Java Basics

Professional Development

14 Qs

Escalada da Lógica de Programação com JavaScript

Escalada da Lógica de Programação com JavaScript

Professional Development

20 Qs

Datatypes and Flowcontrol

Datatypes and Flowcontrol

Professional Development

15 Qs

FORMATIVE ASSESSMENT 2 OOPS

FORMATIVE ASSESSMENT 2 OOPS

Professional Development

15 Qs

Java Strings

Java Strings

1st Grade - Professional Development

10 Qs

JavaDemo1

JavaDemo1

Assessment

Quiz

Computers

Professional Development

Medium

Created by

Shefali Arora

Used 6+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one of these lists contains only Java programming language keywords?


class, if, void, long, Int, continue


goto, instanceof, native, finally, default, throws

try, virtual, throw, final, volatile, transient

strictfp, constant, super, implements, do

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is a valid keyword in java?

interface

string

Float

unsigned

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is a valid declarations of a String?

String s2 = 'null';

String s1 = null;

String s3 = (String) 'abc';

String s4 = (String) '\ufeed';

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code:
class Test {

    public static void main(String[] args) {

    for(int i = 0; 1; i++) {

             System.out.println("Hello");

            break;

        }

    }

}

Prints Hello once

Prints Hello infinite times

Prints nothing

Compiler error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?
class Test {

    public static void main(String[] args) {

        for(int i = 0; 1; i++) {

            System.out.println("Hello");

            break;

        }

    }

}

0

20

Compiler Error

Prints Nothing

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?
class Main {

public static void main(String args[]) {

try {

throw 10;

}

catch(int e) {

System.out.println("Got the Exception " + e);

}

}

}

Got the Exception 10

Got the Exception 0

Compiler error

None of these

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What will be the output of the following?
    class Main

    {public static void main (String[] args) {

    try

    {

    int x = 0;

    int y = 5 / x;

    }

    catch (Exception e)

    {

    System.out.println("Exception");

    }

    catch (ArithmeticException ae)

    {

    System.out.println(" Arithmetic Exception");

    }

    System.out.println("finished");

    }};

finished

Compilation error

Exception

Arithmetic exception

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?