Question: This is exercise 9 in chapter 18 from the book building java programs 4th edition, the first problem im having is the return statement that

This is exercise 9 in chapter 18 from the book building java programs 4th edition, the first problem im having is the return statement that says required int and found java.lang.object, how do I fix that? Problem 2 is the for loop statement, why does it say that its a unreachable statement? And how Can I fix that?  This is exercise 9 in chapter 18 from the book building
java programs 4th edition, the first problem im having is the return

package com.company ?inport java .util . PriorityQueue; ?import java . util.canner; 6 public class ktha alleat ( private PriorityQueue poueue 12 ? (Priorityoueue queue, int )t 13 14 15 16 17 18 19 if ( ?? (k-1)) { queue.polloi return queue.po1lo publie Required: Int 1 arga) Systen.in) 23 24 25 26 tr Found: (true) ( System.out.print("Enter the size of the PriorityQe int outersise input.nextint 29 30 throw new IllegalArgumentException O 32 obi.poueue new Priorityoueue (outeraino): 35 .eut. Prins ("Enter the priority queuelenent" + 1+-):-), t?nput . nextInt()); Systen.out.prin("Which amallest lement you want find?*), it th o1obi.poueue.ise kthSmallest maino date. (42 minutes ago)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!