“Fila de Kotlin” Respostas de código

Fila de Kotlin

import java.util.LinkedList


fun main() {

	val queueA = LinkedList<Int>()
    
    queueA.add(1)
    queueA.add(2)

    print(queueA.poll())
}
Shy Stork

Fila de Kotlin

val studentQueue: Queue<String> = LinkedList<String>(mutableListOf("Agni", "Bob", "Chris", "David", "Emily"))
  println(studentQueue) 
  studentQueue.add("Felix")
  println(studentQueue) 
Smoggy Snail

Fila de Kotlin

val studentQueue: Queue<String> = LinkedList<String>(mutableListOf("Agni"))
  val element = studentQueue.element()
  println(element + " : " + studentQueue) 
  
  studentQueue.remove() 
Smoggy Snail

Fila de Kotlin

val studentQueue: Queue<String> = LinkedList<String>(mutableListOf("Agni"))
  val removedElement = studentQueue.remove()
  println(removedElement + " : " + studentQueue)
Smoggy Snail

Respostas semelhantes a “Fila de Kotlin”

Perguntas semelhantes a “Fila de Kotlin”

Procure respostas de código populares por idioma

Procurar outros idiomas de código