1) Find the Merge point of two linked lists.
2) Swap two bits of integer.
3) Reverse individual words of the sentence.
4) Reverse string without using temp string.
Answer Posted / imran shaik
public class ReverseSentence {
public static void main(String[] args) {
System.out.println("please enter the Sentence");
Scanner input = new Scanner(System.in);
String s1 = input.nextLine();
String s[] = s1.split(" ");
String s3 = "";
int len = s.length;
for (int i = len - 1; i >= 0; i--) {
s3 = s3.concat(s[i]);
s3 = s3.concat(" ");
}
System.out.println(s3.trim());
}
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
Is a method a function?
What is java ceil?
What restrictions are placed on method overriding in java programming?
Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls
Can we force garbage collector to run ?
What is an anonymous class in java?
What is java jit compilers?
What is a singleton puppy?
What is the hashcode () and equals () used for?
What do you understand by garbage collection in Java? Can it be forced to run?
What do you mean by compiler?
What is r in java?
What is character in data type?
What is variable and example?
What is the current version of java?