Created
August 29, 2014 08:16
-
-
Save YuukiARIA/b79062edcd2a25f397de to your computer and use it in GitHub Desktop.
This file contains 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 sandbox; | |
class First | |
{ | |
public static Second setName(String name) | |
{ | |
return new Second(name); | |
} | |
} | |
class Second | |
{ | |
private String name; | |
public Second(String name) | |
{ | |
this.name = name; | |
} | |
public UpperName toUpper() | |
{ | |
return new UpperName(name); | |
} | |
} | |
class UpperName | |
{ | |
private String name; | |
public UpperName(String name) | |
{ | |
this.name = name.toUpperCase(); | |
} | |
public String toString() | |
{ | |
return name; | |
} | |
} | |
public class Main | |
{ | |
public static void main(String[] args) | |
{ | |
UpperName name = First.setName("test").toUpper(); | |
System.out.println(name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment