Swift

A vibrant illustration of a programmer at work, surrounded by code snippets, a laptop displaying Swift syntax, and a futuristic space theme.

Test Your Swift Skills!

Put your knowledge of Swift programming to the test with this engaging quiz! Whether you're a beginner or an experienced developer, you'll find challenging questions that cover various aspects of the Swift language.

✔︝ 12 carefully crafted questions
✔︝ Test your understanding of syntax and concepts
✔︝ Instant feedback on your answers

12 Questions3 MinutesCreated by CodingWizard752
Agrega tu nombre
Cual es la palabra con la cual declaramos una constante en swift
Const
Let
Var
Que imprime el siguiente código

class Starship {
    var type: String
    var age: Int
}

let serenity = Starship(type: "Firefly", age: 24)
print(serenity.type)
Firefly
No compila
Compila pero crashea
Cuantos strings tendrá el array al terminar la ejecución?

let
names = [String]() names.append("Amy") names.append("Clara") names.append("Rory")
0
1
2
3
Elcódigo compila pero crashea
No compila
Que imprime el siguiente código:
for I in 1...3 {
    print(i)
}
1, 2
1, 2, 3
2
2,3
El código no compila
El código crashea
Que imprime el codigo siguiente:

let I = 3

 

switch I {

case 1:

    print("Number was 1")

case 2:

    print("Number was 2")

case 3:

    print("Number was 3")

default:

    print("otro valor")

}

No compila
Crashea el código
No imprime nada
Number was 3
Number was 2
Que imprime el siguiente código:

let names = ["Amy", "Clara"]

for I in 0 ... names.count {

    print("Hello, \(names[i])!")

}

Hello, Amy! Hello, Clara!
No compila
El código crashea en ejecución
Que imprime el siguiente codigo:

let I = "5"

let j = I + i

print(j)

No compila porque no se puede sumar dos strings
Compila pero crashea
55
10
Que pasa con el siguiente codigo:
 
final class Dog {
    func bark() {
        print("Woof!")
    }
}

class Corgi : Dog {
    override func bark() {
        print("Yip!")
    }
}

let muttface = Corgi()
muttface.bark()
Imprime "Yip!"
Imprime "Woof!"
Error al sobre escribir una clase final
Que imprime el siguiente código
 

struct Starship {

    var name: String

}

 

let tardis = Starship(name: "TARDIS")

var enterprise = tardis

enterprise.name = "Enterprise"

 

print(tardis.name)

TARDIS
Enterprise
No compila
Crashea en ejecución
Que tipo de dato tiene i
 

let I = 10.2

Float
Double
No tiene ya que no se especifico el tipo de dato
Propiedades de una clase
No heredan
Son de tipo Referencia
Son de tipo Valor
{"name":"Swift", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Put your knowledge of Swift programming to the test with this engaging quiz! Whether you're a beginner or an experienced developer, you'll find challenging questions that cover various aspects of the Swift language.✔︝ 12 carefully crafted questions✔︝ Test your understanding of syntax and concepts✔︝ Instant feedback on your answers","img":"https:/images/course2.png"}
Powered by: Quiz Maker