in Education by
Write a program in JAVA to input a sentence reverse every word and print . Please answer someone. Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Answer: Java Program to reverse each word in String public class StringFormatter { public static String reverseWord(String str){ String words[]=str.split(“\s”); String reverseWord=””; for(String w:words){ StringBuilder sb=new StringBuilder(w); StringBuilder sb=new StringBuilder(w);sb.reverse(); reverseWord+=sb.toString()+” “;

Related questions

0 votes
    How to write a program in JAVA to print the sum of ASCII values of a particular word input ? Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and ... present. Java class 10 Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Write a program to take a string parameter (st) of a function reversing(). Reverse the sentence in sucha way so ... None Hate All Love Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    java program to input any string then print each word along with their length Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    write a program in Java to input a number and print if it is a special number or not. do this program using ... nested and while loop . Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    input a sentence and print total number of times consecutive alphabet comes using for and charAt function The sentence ... is studying Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    Write a program to store 10 names in an array. Arrange these in alphabetical orderby sorting. Print the sorted list. ... , LUCY, etc. Select the correct answer from above options...
asked Dec 12, 2021 in Education by JackTerrance
0 votes
    write a program to input a number and print table of the number using while loop Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    write a program to input number and print wether it is even or odd. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    Write a menu-driven program to print the following patterns, where number of rows for the pattern should be the user ... 2 4 8 32 Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    write a Java program to input 10 non-zero numbers in an array and display the count of even and odd numbers. URGENT! Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Write a program in Java to input any age and determine whether the age is valid or  invalid. If age is ... is valid otherwise invalid. Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to store the marks of any 5 subjects in different variables. Calculate total and average. ... ANY INPUT METHOD Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to find the area and perimeter of a square and rectangle. Store side in s , length as ... USE ANY INPUT METHOD Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    write a java program to print areaof an equilateral triangle . (without using scanner) Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
...