2016-10-13 14:13:36 +00:00
|
|
|
import java.io.*;
|
|
|
|
|
|
|
|
public class NameTester{
|
|
|
|
public static void main(String [] args){
|
2016-10-18 10:04:36 +00:00
|
|
|
|
|
|
|
Name persona = new Name();
|
|
|
|
persona.setTitle("Sig.");
|
|
|
|
persona.print(System.out); //We expect Sig.
|
2016-10-13 14:13:36 +00:00
|
|
|
|
2016-10-18 10:04:36 +00:00
|
|
|
persona = new Name("Mario", "Rossi");
|
|
|
|
System.out.println(persona.getInitials()); //We expect M. R.
|
2016-10-13 14:13:36 +00:00
|
|
|
|
2016-10-18 10:04:36 +00:00
|
|
|
persona = new Name("Jon", "Snow", "King in the North");
|
|
|
|
System.out.println(persona.getNameSurname()); //We expect Jon Snow
|
|
|
|
System.out.println(persona.getTitleNameSurname()); //We expect a very big spoiler
|
2016-10-13 14:13:36 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|