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

why java not supproting multiple inheritance?

5 Answers  


What is the difference between Java and C++?

0 Answers   Integreon, TCS, ZS Associates,


You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain

0 Answers  


What are the 7 types of characters?

0 Answers  


What is a parameter in simple terms?

0 Answers  


Is string passed by reference in java?

0 Answers  


Tell me the difference between an applet and a Japplet?

1 Answers  


How to handle a web browser resize operation?

0 Answers  


What is super keyword in java ?

1 Answers  


How the interruptible method gets implemented?

0 Answers  


What is the difference between && and & in java?

0 Answers  


Why lambda expression is used in java?

0 Answers  


Categories