Watch This Video
class Person{
String firstName,lastName
def dob
//private | protected |public
protected String f1,f2,f3
private Date createdOn= new Date()
static welcomeMsg="Hello"
public static final String WELCOME_MSG="HELLO"
}
//LOCAL VARIABLES
def foo(){
String msg ="Hello"
String firstName="Dan"
println"$msg, $firstName"
}
}
def Person =new Person()
println Person.foo()
No comments:
Post a Comment
Note: only a member of this blog may post a comment.