Public Class Stringtest {
/**
* @ Param ARGs
*/
Stringtest (){
}
Stringtest (string temp ){
STR = temp;
}
Public String STR;
Public Void Show (){
System. Out. println (STR );
}
Public Void Strfirst (){
STR = Str. replacefirst (Str. substring (0, 1), str. substring (0, 1). touppercase ());
System. Out. println (STR );
}
Public Void Showlength (){
System. Out. println ("str. Length =" + Str. Length ());
}
Public Void Showforth (){
System. Out. println ("str. charat (3) =" + Str. charat (3 ));
}
Public Void Showboy (){
Int Lastindex = Str. lastindexof ("");
System. Out. println ("last word:" + Str. substring (lastindex ));
}
Public Static Void Main (string [] ARGs ){
// Todo auto-generated method stub
Stringtest strtest = New Stringtest ("You are a good boy ");
Strtest. Show ();
Strtest. strfirst ();
Strtest. showlength ();
Strtest. showforth ();
Strtest. showboy ();
}
}