subject

First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).

Then, create a new Java application called "StringLength" (without the quotation marks) that requests a String from the user at the command line and finds its length. Your program should output: "Your string has a length of X characters." where X is the String's length. Allow for the String to be one or more words of input. Be sure to use the suitable method for determining the length of the String.

I have the below code but it is only giving me the output that "Your string has a length of x characters". it is not outputting that Hello, my name is John Smith.

package stringlength;

import java. util. Scanner;

public class StringLength
{

public static void main(String[] args) {
if(args. length > -1) {

String input = args[0];

int length = input. length(); // using length() method in String class
System. out. println("Your string has a length of "+length+" characters.");

System. out. println("Your string has a length of "+length+" characters.");
}
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:30
Which of the choices sean are not true when considering virus behavior
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-à-vis other ad-serving companies?
Answers: 2
You know the right answer?
First, launch NetBeans and close any previous projects that may be open (at the top menu go to File...
Questions
question
Mathematics, 04.12.2020 17:40
question
Mathematics, 04.12.2020 17:40
question
Mathematics, 04.12.2020 17:40
question
Mathematics, 04.12.2020 17:40
question
Mathematics, 04.12.2020 17:40
question
Mathematics, 04.12.2020 17:40
question
Arts, 04.12.2020 17:40
question
History, 04.12.2020 17:40
Questions on the website: 13722367