AmbitionBox

Discover Best Places to work in India

Java Programming

Java Programming Questions and Answers

Showing 81 - 90 of 150 questions

81

What is the priority of the thread in output of this program?

classmultithreaded_programing{
        publicstaticvoidmain(String args[]){
            Thread t = Thread.currentThread();
            t.setName("New Thread");
            System.out.println(t.getName());        
        }
    }
a

main

b

Thread

c

New Thread

d

Thread[New Thread,5,main]

correct answer c
82

What is the name of the thread in output of this program?

classmultithreaded_programing{
        publicstaticvoidmain(String args[]){
            Thread t = Thread.currentThread();
            System.out.println(t.getPriority());        
        }
    }
a

0

b

1

c

4

d

5

correct answer d
83

Which methods are utilized to control the access to an object in multi threaded programming

a

Asynchronized methods

b

synchronized methods

c

Serialized methods

d

None of these

correct answer b
84

Which of the following is used to force each thread to reconcile its working copy of a variable with the master copy in main memory?

a

Synchronized 

b

transient

c

volatile

d

native

correct answer c
85

What is multithreaded programming?

a

It’s a process in which two different processes run simultaneously.

b

It’s a process in which two or more parts of same process run simultaneously.

c

Its a process in which many different process are able to access same information.

d

Its a process in which a single process can access information from many sources.

correct answer b,c
86

Thread priority in Java is?

a

Integer

b

Float

c

double

d

long

correct answer a,b
87

What will happen if two thread of same priority are called to be processed simultaneously?

a

Any one will be executed first lexographically

b

Both of them will be executed simultaneously

c

None of them will be executed

d

It is dependent on the operating system.

correct answer d
88

What is the priority of the thread in output of this program?

classmultithreaded_programing{
        publicstaticvoidmain(String args[]){
            Thread t = Thread.currentThread();
            System.out.println(t);        
        }
    }
a

4

b

5

c

0

d

1

correct answer b
89

What is the name of the thread in output of this program?

classmultithreaded_programing{
        publicstaticvoidmain(String args[]){
            Thread t = Thread.currentThread();
            System.out.println(t);        
        }
    }
a

main

b

thread

c

system

d

None of these

correct answer a
90

What is the name of the method used to start a thread execution?

a

init()

b

start()

c

run()

d

resume()

correct answer b
Select a company to compare with

vs

Similar Companies