Skip to content
Snippets Groups Projects
Commit 6b82816d authored by Markus Trietz's avatar Markus Trietz
Browse files

Upload New File

parents
Branches
No related tags found
No related merge requests found
public class Longest {
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("No parameters");
return;
}
int max_length = 0;
String max_string = "";
for (String e : args) {
if (e.length() > max_length) {
max_length = e.length();
max_string = e;
}
}
System.out.println("Longest parameter: ".concat(max_string));
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment