String Class Quiz
star
star
star
star
star
Posljednje ažuriranje about 2 years ago
5
DIRECTIONS : Fill in each blank with the proper java code.
public class LetterFun
{
private String word;
public LetterFun(String s)
{
///Blank One///
}
public void setString(String s)
{
///Blank Two///
}
public char getLastLetter()
{
///Blank Three///
}
public char getFirstLetter()
{
///Blank Four///
}
public String toString()
{
///Blank Five///
}
}
//code in the main of another class
LetterFun getIt = new LetterFun("Spider");
System.out.println(getIt.getFirstLetter());
System.out.println(getIt.getLastLetter());
System.out.println(getIt);
Write code for blank 1
Write code for blank 2
Write code for blank 3
Write code for blank 4
Write code for blank 5