subject

Write a program that prints all nonempty substrings of a string, in decreasing length, starting with the substrings at the front of the string. for example, if the string is "fred", you print

fred
fre
red
fr
re
ed
f
r
e
d
given:

import java. util. scanner;
public class printallsubstrings
{
/**
prints all non-empty substrings of a given word in decreasing
length, starting with the substrings at the front of the string.
@param word the word whose substrings are to be printed.
*/
public static void printallsubstrings(string word)
{
. .
}

public static void main(string[] args)
{
scanner in = new scanner(system. in);
system. out. print("enter a word: ");
string input = in. next();
printallsubstrings(input);
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
(, urgent need): how do i change my username
Answers: 1
question
Computers and Technology, 24.06.2019 16:50
Ramp charts are generally created in wordlotusexcelpowerpoint
Answers: 1
question
Computers and Technology, 24.06.2019 18:00
Why is a multiview sketch drawinf different from other sketches like isometric, two point, and oblique
Answers: 1
You know the right answer?
Write a program that prints all nonempty substrings of a string, in decreasing length, starting with...
Questions
question
Mathematics, 24.09.2019 14:50
question
Mathematics, 24.09.2019 14:50
question
Geography, 24.09.2019 14:50
question
Mathematics, 24.09.2019 14:50
Questions on the website: 13722361