Created
July 29, 2012 08:45
-
-
Save madankumarpc/3196758 to your computer and use it in GitHub Desktop.
Groovy beans
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.learn.example7.classes | |
class Song { | |
def name | |
def artist | |
def genre | |
String toString() | |
{ | |
"${name} is a great song of genre type ${genre} composed by the artist ${artist}" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.learn.example7.classes; | |
public class Songs { | |
private String name; | |
private String artist; | |
private String genre; | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public String getArtist() { | |
return artist; | |
} | |
public void setArtist(String artist) { | |
this.artist = artist; | |
} | |
public String getGenre() { | |
return genre; | |
} | |
public void setGenre(String genre) { | |
this.genre = genre; | |
} | |
public String toString() | |
{ | |
return name+"is a great song of genre type" +genre+ "composed by the artist "+artist; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment