Categories
|
Test: Swift - Boolean Types 2. Which of the following can be assigned to a bool variable in Objective-C to make it true?
Results Congratulations! Correct Answer. You Answered: None. If you took the test, your answer will show up here. Correct Answer: 1; True; YES; 100; Explanation In Objective-C, boolean false is 0 and true is non-zero. YES and True are #defined to 1 in various header files and hence they act as true. When checked in an if control statement, a variable with any of the above values will test positive.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 2 of 5
Test is Based on this Article
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.
|
|
More Articles With Similar Tags
|
Test on Boolean 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 goes through the usage of various integer types in Swift (including Int and UInt).
|
Test on Integer types in Swift.
|
This article talks about decimal numbers in Swift, including Float, Double, and CGFloat. Also talks about Binary, Octal, and Hexadecimal representations.
|
|
|
|
|