1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
valina [46]
3 years ago
6

The java class library interface queue method tagg retrieves the entey at the front of a queue but themrows a NosuchElementExcep

tion if the queue was empty is
A.poke

B.empty

C.look

D.peek
Computers and Technology
1 answer:
SCORPION-xisa [38]3 years ago
5 0

Answer:D) peek

Explanation:Peek operation or function is the method that is used for the returning of the values on the front of the queue or stack type datatypes.               This operation function over those datatypes having group or collection of the elements and does not eliminate any element from the queue.

NOsuchElemnet exception is shown when there is the peek operation in the queue for the element to be displayed on the top and no deletion can take place .Thus, the correct option is option(D).

You might be interested in
How to improve and create beautiful graphic
kaheart [24]

Answer:

Learn OpenGL and any graphics rendering program.

Explanation:

3 0
3 years ago
Hymter. Wants to workin The Energy career field with electrical energy
m_a_m_a [10]

Answer: what is the question

Explanation:

3 0
3 years ago
Use semaphore(s) to solve the following problem. There are three processes: P1, P2, and P3. Each process Pi has a segment of cod
Lisa [10]

Answer:

See explaination

Explanation:

Here we will use two semaphore variables to satisfy our goal

We will initialize s1=1 and s2=1 globally and they are accessed by all 3 processes and use up and down operations in following way

Code:-

s1,s2=1

P1 P2 P3

P(s1)

P(s2)

C1

V(s2) .

P(s2). .

. C2

V(s1) .

P(s1)

. . C3

V(s2)

Explanation:-

The P(s1) stands for down operation for semaphore s1 and V(s1) stands for Up operation for semaphore s1.

The Down operation on s1=1 will make it s1=0 and our process will execute ,and down on s1=0 will block the process

The Up operation on s1=0 will unblock the process and on s1=1 will be normal execution of process

Now in the above code:

1)If C1 is executed first then it means down on s1,s2 will make it zero and up on s2 will make it 1, so in that case C3 cannot execute because P3 has down operation on s1 before C3 ,so C2 will execute by performing down on s2 and after that Up on s1 will be done by P2 and then C3 can execute

So our first condition gets satisfied

2)If C1 is not executed earlier means:-

a)If C2 is executed by performing down on S2 then s2=0,so definitely C3 will be executed because down(s2) in case of C1 will block the process P1 and after C3 execute Up operation on s2 ,C1 can execute because P1 gets unblocked .

b)If C3 is executed by performing down on s1 then s1=0 ,so definitely C2 will be executed now ,because down on s1 will block the process P1 and after that P2 will perform up on s1 ,so P1 gets unblocked

So C1 will be executed after C2 and C3 ,hence our 2nd condition satisfied.

4 0
3 years ago
Anthony is deciding between different savings accounts at his bank. He has four options, based on how frequently interest compou
anastassius [24]
He should pick the most reliable one.

Hope this helps.

4 0
3 years ago
The enter/return key is struck by the
Black_prince [1.1K]

Answer:

B

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • The fundamental difference between a switch and a router is that a switch belongs only to its local network and a router belongs
    10·1 answer
  • The requirement that each term in the objective function only contains a single variable is in a linear program is referred to a
    5·1 answer
  • The natural language convention used to represent ip addresses is called the:
    15·1 answer
  • Define additional characteristics such as font weight or style for an html tag
    5·1 answer
  • .true or false? one disadvantage of cloudware is that it is never free<br> A. true<br> B. false
    12·1 answer
  • Which of the following is true regarding the use of instance variable j in class B1?
    15·1 answer
  • What is DMTS. Explain it​
    10·2 answers
  • Create an application that determines the final cost of food items and non-food items, assuming only non-food items are taxed. T
    8·1 answer
  • Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint:
    5·1 answer
  • Areas on which the development of the computer as a communication technology is based
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!