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 18:30
What is outfitting a workplace with video in a technology
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
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, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Health, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
question
Spanish, 10.09.2020 08:01
question
Mathematics, 10.09.2020 08:01
Questions on the website: 13722367