Quizz_TG

Quizz_TG

University

40 Qs

quiz-placeholder

Similar activities

US and TX Constitution Exam

US and TX Constitution Exam

University - Professional Development

40 Qs

CFAS - Conceptual Framework

CFAS - Conceptual Framework

University

35 Qs

Review Cost Accounting 2

Review Cost Accounting 2

University

35 Qs

Explore!

Explore!

University

42 Qs

ELEMENTS OF CONTRACT

ELEMENTS OF CONTRACT

University

45 Qs

QBB2023/QCB2033 SEPT 2020 QUIZ 1

QBB2023/QCB2033 SEPT 2020 QUIZ 1

University

40 Qs

【再】IDS Education Tab

【再】IDS Education Tab

KG - University

35 Qs

Demon slayer- Spoiler warning

Demon slayer- Spoiler warning

3rd Grade - Professional Development

44 Qs

Quizz_TG

Quizz_TG

Assessment

Quiz

Other

University

Practice Problem

Easy

Created by

Q Mr.

Used 6+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • Ungraded

Media Image

What is the output for the below code ?

Compile fail due to error on line no 2
Compile fail due to error on line no 9
Compile fail due to error on line no 8
15

2.

MULTIPLE CHOICE QUESTION

2 mins • Ungraded

Media Image

What is the output for the below code ? public class A { int k; boolean istrue; static int p; public void printValue() { System.out.print(k); System.out.print(istrue); System.out.print(p); } } public class Test { public static void main(String argv[]) { A a = new A(); a.printValue(); } }

0 false 0
0 true 0
0 0 0
Compile error - static variable must be initialized before use.

3.

MULTIPLE CHOICE QUESTION

2 mins • Ungraded

Media Image

What is the output for the below code ? package com; class Animal { public void printName() { System.out.println("Animal"); } } package exam; import com.Animal; public class Cat extends Animal { public void printName() { System.out.println("Cat"); } } package exam; import com.Animal; public class Test { public static void main(String[] args) { Animal a = new Cat(); a.printName(); } }

Animal
Cat
Animal Cat
Compile Error

4.

MULTIPLE CHOICE QUESTION

2 mins • Ungraded

Media Image

What is the output for the below code ? public class A { static { System.out.println("static"); } { System.out.println("block"); } public A() { System.out.println("A"); } public static void main(String[] args){ A a = new A(); } }

A block static
static block A
static A
A

5.

MULTIPLE CHOICE QUESTION

2 mins • Ungraded

Media Image

What is the output for the below code ? 1. public class Test { 2. public static void main(String[] args){ 3. int i = 010; 4. int j = 07; 5. System.out.println(i); 6. System.out.println(j); 7. } 8. }

8 7
10 7
Compilation fails with an error at line 3
Compilation fails with an error at line 5

6.

MULTIPLE CHOICE QUESTION

2 mins • Ungraded

Media Image

What is the output for the below code ? public class Test { public static void main(String[] args) { String value = "abc"; changeValue(value); System.out.println(value); } public static void changeValue(String a) { a = "xyz"; } }

abc
xyz
Compilation fails
Compilation clean but no output

7.

MULTIPLE CHOICE QUESTION

2 mins • Ungraded

Media Image

try{ File f = new File("a.txt"); }catch(Exception e){ }catch(IOException io){ } Is this code create new file name a.txt ?

True
False
Compilation Error
None

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?