Code example for PriorityQueue

Methods: peek

0
errorQueue.add(error);
	} 
 
	public static String getMessage() {
		return queue.peek();
	} 
 
	public static String getError() {
		return errorQueue.peek();
	} 
 
	public static String removeError() {
		return errorQueue.poll();
	} 
 
	public static void removeMessage() { 
		queue.poll();
	} 
}