Java Concepts Quiz

Java Concepts Quiz

University

18 Qs

quiz-placeholder

Similar activities

CD UNIT  1 QUIZ

CD UNIT 1 QUIZ

University

20 Qs

EBUS2-3

EBUS2-3

University

17 Qs

Kuesioner Penelitian

Kuesioner Penelitian

University

20 Qs

SCMH - Make Vs. Buy Decision (Group D - Week 10)

SCMH - Make Vs. Buy Decision (Group D - Week 10)

University

20 Qs

Doctor Strange

Doctor Strange

4th Grade - University

16 Qs

Minecraft

Minecraft

1st Grade - University

16 Qs

EET 12 Quiz 2

EET 12 Quiz 2

University

20 Qs

Python Quiz For Starters

Python Quiz For Starters

3rd Grade - Professional Development

17 Qs

Java Concepts Quiz

Java Concepts Quiz

Assessment

Quiz

Other

University

Medium

Created by

Crackify Crackify

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Where is a local variable stored in Java?

Stack

Heap

PermGen

Code Segment

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which memory area stores objects in Java?

Stack

Heap

Method Area

Registers

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method returns the hash code of an object?

hashValue()

hash()

hashCode()

getHash()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the contract between equals() and hashCode()?

If two objects are equal, they must have the same hash code

If hash codes are same, objects are always equal

They are unrelated

Only equals() matters in Collections

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you override equals() but not hashCode()?

Compilation error

Runtime error

May break hash-based collections

Nothing happens

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data structure does HashMap use internally?

Array

LinkedList

Array + LinkedList/Tree

TreeMap

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to compare contents of two strings?

==

equals()

compare()

hashCode()

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?