1

I noticed that

Program A

 var okie=Int(2)

 print(okie)

Program B

 var okie:Int=2

 print(okie)

Output

2

I noticed that program A and program b works on the same way, Can any on elaborate what is happening

  • 1
    What do you mean by _Creating type of the class_, I guess, in both the cases you are creating an _instance of type **Int**_ . It's just that in _Program B_, you're _inferring the type to be Int_ . – Shubham Bakshi Dec 26 '18 at 06:46
  • If you go with this https://docs.swift.org/swift-book/LanguageGuide/ClassesAndStructures.html, then you get your solution – Abhishek Jadhav Dec 26 '18 at 07:02

0 Answers0