Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

Tag Archive for ‘add’

AWT Choice Control Explained

AWT Choice Control Example

Top portion of the Frame window has the AWT Choice Control. There are two Text fields in the Frame. The first one takes a string and adds it to the Choice Control via Add button click. The next text field is used to display the selected text of the Choice Control. Moreover, the Remove button click will use this text field to delete an item in the Choice.

Continue Reading →

Using Java Queue via LinkedList

Getting Queue Element From Head For Inspecting

The Queue operates on ‘First In First Out (FIFO)’ principle. This means an element added first to the Queue removed first from the queue. For example, in a railway ticket counter the person who enters the queue first will be served first and removed from the queue. Each new person coming to buy the ticket will stand in the tail end of the queue. The same Queue will work in Java. In simple words, elements are added to the tail end of the Queue and removed from the head of the Queue.

In this example, we will see how to use Java Linked as a Queue.

Continue Reading →