Datasets:
ArXiv:
License:
Download data/train/akash-coded/FSD_Java/Lesson-4/Queue/Examples/QueueExample.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 667 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-4/Queue/Examples/QueueExample.java
- Command line
-
hf download hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-4/Queue/Examples/QueueExample.java
-
curl -L -o QueueExample.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-4/Queue/Examples/QueueExample.java
667 Bytes
| import java.util.*; | |
| public class QueueExample { | |
| public static void main(String[] args) { | |
| Queue<String> locationsQueue = new LinkedList<>(); | |
| locationsQueue.add("Kolkata"); | |
| locationsQueue.add("Patna"); | |
| locationsQueue.add("Delhi"); | |
| locationsQueue.add("Gurgaon"); | |
| locationsQueue.add("Noida"); | |
| System.out.println("Queue is : " + locationsQueue); | |
| System.out.println("Head of Queue : " + locationsQueue.peek()); | |
| locationsQueue.remove(); | |
| System.out.println("After removing Head of Queue : " + locationsQueue); | |
| System.out.println("Size of Queue : " + locationsQueue.size()); | |
| } | |
| } | |