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 |
Why do we use bufferedreader?
Why java is not 100% object-oriented?
What are parsers? Dom vs sax parser.
Can an interface extend a class?
What function extracts specified characters from a string?
How do you write methodology?
Write a program to calculate factorial in java?
What does method mean?
write a program to create an vector with string(add,remove) operation.and value should be enter through keyboard.
What is access modifiers?
Can we declare a class as static?
How to store image in arraylist in java?