Function with parameter
Android Swift
// Declare a function with defult parameter
void sayHello(String name)
{
  
  Log.e("your name : ",""+ name);
}

// Let's call it with param
sayHello("phanthanhca.com")

 

// Declare a function with defult parameter
func sayHello(name : String ) {
    print ("Hello \(name)")
}

// Let's call it with param
sayHello("phanthanhca.com")

 

 

Comments