Categories
|
Test: Swift - Integer Types 1. var score = 100 - What is the inferred type of score in Swift?
Results Congratulations! Correct Answer. You Answered: None. If you took the test, your answer will show up here. Correct Answer: Int Explanation In Swift, if you assign an integer literal during the declaration of variable or constant (without specifying its type), Swift will infer it to be of type Int. Here, the value 100 will fit inside an Int8, but it will still be of type Int.Take the Test Take the complete test on this topic. You will be able to review answers to questions and get a test score.
Take the Test
Question 1 of 5
Test is Based on this Article
This article goes through the usage of various integer types in Swift (including Int and UInt).
|
Test on Integer types in Swift.
|
|
More Articles With Similar Tags
|
Test on Integer types in Swift.
|
This series of articles goes through the basics of Swift. It introduces Playgrounds and REPL; Variables and Constants; Int, Float, Bool; Tuples, Type Aliases, Type Inference, Type Safety, and more.
|
This article discusses the boolean types in Swift and contrasts with how these types are used in C and Objective-C.
|
Test on Boolean Types in Swift.
|
This article talks about decimal numbers in Swift, including Float, Double, and CGFloat. Also talks about Binary, Octal, and Hexadecimal representations.
|
|
|
|
|