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

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -