Watch This Video
@groovy.transform.ToString
class Person{
String first,last
//Constractor
Person(String fullName){
List parts =fullName.split(' ')
this.first=parts[0]
this.first=parts[1]
}
//methods
public void foo(String a, String b){
//do stuff
}
String getFullName(){
"$last $first"
}
def bar(){
}
ststic String doGoodWork(){
println "do some good work............"
}
List someMethod (List num=[1,,2,3] Boolean canAccessAll=false){
}
}
/*Person p= new Person ("Dan Vega")
println p */
Person.doGoodWork()
No comments:
Post a Comment
Note: only a member of this blog may post a comment.