Groovy web console

subscribe to the feed Subscribe
to this
site
Gro0vySample (via #groovywebconsole)
tweet this snippet Tweet
this
script

Gro0vySample

Published 5 months ago by TutsPoint with tags Examples
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class Student {
   private int StudentID;
   private String StudentName;
    
   void setStudentID(int pID) {
      StudentID = pID;
   }
    
   void setStudentName(String pName) {
      StudentName = pName;
   }
    
   int getStudentID() {
      return this.StudentID;
   }
    
   String getStudentName() {
      return this.StudentName;
   }
    
   static void main(String[] args) {
      Student st = new Student();
      st.setStudentID(1);
      st.setStudentName("Joe");
        
      println(st.getStudentID());
      println(st.getStudentName());
   } 
}