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
xxTIMURxx [149]
4 years ago
10

The java class library interface queue method to put an entey on the back of a queue that returns false if the method falls is

Computers and Technology
1 answer:
Mars2501 [29]4 years ago
5 0

Answer:

(A) Add.

Explanation:

The add method of queue inserts an element at the tail of the queue.

syntax:- queue.add(element);

It's return type is boolean it returns true if the insertion is successful and returns false if the insertion is unsuccessful and it returns an IllegalSpace Exception if there is no space left to insert an element in the queue.

You might be interested in
Write the one Sale method of the GroceryStore class. Method oneSale has one parameter: the name of one product (that a customer
DIA [1.3K]

Answer:

Check the explanation

Explanation:

bool oneSale(string item){

for(int i=0;i<capacity;i++){ // iterate till the capcity of array

if(item==grocerryList[i].name()){ // if name matches

 if(grocerryList[i].getStock()>0){ // and stock is greater than 0

  grocerryList[i].setStock(grocerryList[i].getStock()-1); // subtract 1 from the stock

// or alternate is grocerryList[i].stock= grocerryList[i].stock-1;

 return true; // return true

}

}

else if(item==grocerryList[i].name()){ // if name matches

 if(grocerryList.getStock()==0){ // but stock is empty

 return false; // return falsse

}

}

else{ // means item is not available so there is no need to check stock

return false; // return false

}

}

}

8 0
3 years ago
What are the advantages of using a folder?​
Fofino [41]

Answer:

1. easy access to files

2. better organization

Explanation:

8 0
3 years ago
Which invention allowed computers to become smaller in size?
dexar [7]
computers got smaller because one of its main components the valve – was replaced by the much smaller transistor.
7 0
3 years ago
Passing by reference is used if a parameter's data flow is A. one-way, into the function. B. one-way, out of the function. C. tw
tiny-mole [99]

Passing by reference is used if a parameter's data flow is two-way, into and out of the function.

C. two-way, into and out of the function.

<u>Explanation:</u>

If a function in programming language passing the parameter by reference means it only sending the address of parameter to a function. If any value is changed on reference parameter it will changed original value.

If parameter passed by value means it is one way, where value been send to the function.

Whereas by reference means it two-way, in and out of the function. Mostly it called as pointer.

It is available in c , c++, where declare of variable “*” or “&” address off.

4 0
4 years ago
Meg[] elements = {new Lois(), new Stewie(), new Meg(), new Brian()}; for (int i =0; i
Stells [14]

Complete question is attached as snapshot.

Answer:

This will result in a compilation error.

Here's the inheritance hierarchy:

Meg -> Lois -> Brian -> Stewie

Now Meg has 2 public Fxns, a() and toString().

Lois inherits from Meg and all its public functions as well but, overrides the a() fxn of its super class.

So finally Lois has fxns a(), b() and toString().

Brian extends Lois and inherits all the above listed fxns of Lois, but overrides the b() and toString() fxns.

Stewie extends Brian and inherits all the fxns of Brian, but overrides the a() and toString() fxns.

In the Main driver fxn, we call a() and b() methods of all these classes but, the base class Meg has no b() and it is not extending any class so its not available in its scope.

This results in a compilation error.

Explanation:

7 0
3 years ago
Other questions:
  • How do you use the Internet? Think about your typical day. When are you using the Internet? For what purposes? What role does it
    11·1 answer
  • This diagram shows a number of computing devices connected to the Internet with each line representing a direct connection.
    11·1 answer
  • What are the three types of event logs generated by windows 2003 and vista systems?
    12·1 answer
  • 3 applications of cumulative probability distribution in medical field?​
    9·1 answer
  • Examine the following class definition:
    10·1 answer
  • BrainPower Tutoring The owner of BrainPower Tutoring needs an application to calculate and print estimates to provide to potenti
    14·1 answer
  • You are a Data Scientist at Anthem Blue Cross Blue Shield. You want to check if a patient will develop diabetes. Please write th
    5·1 answer
  • 1. Write a 400-500 word research report about Burke High School.
    6·1 answer
  • Why do we need on output device?​
    11·2 answers
  • When formulating a linear programming model on a spreadsheet, the decisions to be made are located in the data cells.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!