Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package string;
- import java.util.Scanner;
- public class lengthString {
- public static void main(String [] args) {
- Scanner in = new Scanner(System.in);
- System.out.print("Enter string: ");
- String str = in.nextLine();
- String current = str;
- boolean stop = str.equals("***");
- while(!(stop)) {
- System.out.print("Enter next string: ");
- str = in.nextLine();
- if(str.length() > current.length()) {
- current = str;
- }
- }
- System.out.println("The biggest string is "+current);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement