Search Header Logo

Best Practices in Java

Authored by Alpana Sonje

Computers

University

Used 3+ times

Best Practices in Java
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct way to resolve following error? @Override

public void run() { Thread.sleep(300); }

Surround with try/catch

Add throws declaration

Either A or B

None of the mentioned

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the suitable name for the method used to check whether given number is prime or not?

prime()

checkprime()

isPrime()

getPrime()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When we have constructor based and setter based injection defined within an entity then which will be called by default?

constructor

setter method

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the default scope for beans in the spring?

Prototype

Singleton

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be output of following code?

public class ChildThread extends Thread {

@Override public void run() {

System.out.println("Hello"); }}

public class ThreadDemo {

public static void main(String[] args) {

ChildThread t1 = new ChildThread();

t1.start();

t1.start(); }}

Hello

Hello

Hello

CTE

RTE

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can one interface implements another interface?

Yes

No

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is used to bind the metadata in hibernate?

SessionFactory

ServiceRegistry

Configuration

SessonRegistry

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?

Discover more resources for Computers