move the first word to the last position in Java -
how can make jave language is language java here code, think there problems here.
public class lab042{ public static final string testsentence = "java language"; public static void main(string [] args) { string rephrased = rephrase( testsentence); system.out.println("the sentence:"+testsentence); system.out.println("was rephrased to:"+rephrased); } public static string rephrase(string testsentence) { int index = testsentence.indexof (' '); char c = testsentence.charat(index+1); string start = string.valueof(c).touppercase(); start += testsentence.substring(index+2); start += " "; string end = testsentence.substring(0,index); string rephrase = start + end; } }
you not returning new phrase. @ bottom of method rephrase(), put this:
return rephrase;
Comments
Post a Comment