Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

Swift self property

class Marks {
  var physics = 0
  func checkEligibility(physics: Int) {

    // using self property
    if (self.physics < physics) {
      print("Not Eligible for admission")
    }

    else {
      print("Eligible for admission")
    }
  }
}

var student1 = Marks()
student1.physics = 28
student1.checkEligibility(physics: 50)
Comment

PREVIOUS NEXT
Code Example
Swift :: Swift Check Subset of a Set 
Swift :: Swift Operator Associativity 
Swift :: disable trailing swipe action swift 
Swift :: Swift Arithmetic Operators 
Swift :: Abstract classes in Swift 
Swift :: swift weekday date component values 
Swift :: Swift Nested Function with Return Values 
Swift :: Swift Labeled Statement with break 
Swift :: swift ease in out animatekeyframes 
Swift :: Function Call Using try Keyword Swift 
Swift :: corner radius with animation swift 
Swift :: swift 5 on return button action 
Swift :: swift overlay view 
Swift :: where to save audio asset swift 
Swift :: Swift for Loop with Stride Function 
Swift :: cellwidget to setvalue 
Ruby :: rails undo scaffold 
Ruby :: rails activestorage get image url 
Ruby :: authrenticate to artifactory grails 2.1.1 
Ruby :: rails link_to class 
Ruby :: create rails project with postgres 
Ruby :: safe navigation operator in ruby 
Ruby :: rails order 
Ruby :: ruby timestamp 
Ruby :: ruby array prepend vs unshift 
Ruby :: rails clear log files 
Ruby :: meaning of {} in ruby 
Ruby :: insert element in array ruby 
Ruby :: random number rails 
Ruby :: each_cons with index ruby 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =