Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Β© A+ Computer Science - www.apluscompsci.com
- //Name -
- //Date -
- //Class -
- //Lab -
- import static java.lang.System.*;
- public class FirstAndLast
- {
- private String word;
- public FirstAndLast(String s)
- {
- word = "null";
- }
- public void setString(String s)
- {
- word = word.substring(0);
- }
- public String getFirst()
- {
- word = word.substring(0);
- return word;
- }
- public String getLast()
- {
- word = word.substring(5);
- return word;
- }
- public String toString()
- {
- String output= word;
- return output;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement