Skip to content

Instantly share code, notes, and snippets.

@wingyplus
Created April 13, 2014 07:33
Show Gist options
  • Save wingyplus/10573289 to your computer and use it in GitHub Desktop.
Save wingyplus/10573289 to your computer and use it in GitHub Desktop.
package main
import "fmt"
type User struct {
Username string
}
func (u User) String() string {
return u.Username
}
func main() {
var win User = User{Username: "Thanabodee"}
fmt.Println("Hello, playground", win)
}
public class User implements Stringer {
private String username;
User(String username) {
this.username = username;
}
@Override
public String String() {
return username;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment