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.
Answers were Sorted based on User's Feedback
Answer / 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 |
What is the difference between hashset and treeset in java?
What is parameters example?
What is assembly language?
What happens when a main method is declared as private?
22 Answers DELL, Infosys, L&T, Sun Microsystems,
What is the is a and has a relation ship in oops concept in java?
Which of the following can be referenced by a variable? A. The instance variables of a class only B. The methods of a class only C. The instance variables and methods of a class
What is core java called?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
What is a treeset class?
What is prime number in java?
What is difference between array and vector?
what are the diffrences between interface and abstract class?