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
I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com
Can we cast any other type to boolean type with type casting?
What are some alternatives to inheritance?
Differentiate between the constructors and methods in java?
What is boolean flag in java?
What is the use of bufferedreader?
What do you understand by java?
What is another word for methodology?
How many bytes is a string?
Can inner class extend any class?
What is an immutable class?
Which is better singleton or static class?
Explain the differences between static and dynamic variables?
What is return code?
Explain the difference between abstract class and interface in java?