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



1) Find the Merge point of two linked lists. 2) Swap two bits of integer. 3) Reverse individual wo..

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

1) Find the Merge point of two linked lists. 2) Swap two bits of integer. 3) Reverse individual wo..

Answer / santosh kumar

refer to net

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More Core Java Interview Questions

What is the difference between math floor and math round?

0 Answers  


What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?

0 Answers  


How to avoid the runtime exception ?

2 Answers  


What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?

0 Answers  


What is function overriding and overloading in java?

0 Answers  






What is means by DLL file means ? What is the use of DLL file? What are the contents of DLL file?

4 Answers  


What is size () in java?

0 Answers  


What is array list in java?

0 Answers  


How many types of exception can occur in a java program?

0 Answers  


In how many ways we can the thread? in java

3 Answers  


what is the volatile modifier for? : Java thread

0 Answers  


Question 6 [9] 6.1 In what situations (in general) would you use a TreeMap? (3) 6.2 In what situations (in general) would you use a HashSet to store a collection of values?

1 Answers  


Categories