Write code which takes a sentence as an input from the user and then prints the length of the first word in that sentence. Hint: think about how you know where the first word ends - you may assume that the sentence contains more than one word.
Input a code in the following:
/* Lesson 3 Coding Activity Question 4 */
import java.util.Scanner;
public class U2_L3_Activity_Four{
public static void main(String[] args){
/* Write your code here */
}
}

Solved
Show answers

Ask an AI advisor a question