Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class esercizio
- {
- // arguments are passed using the text field below this editor
- public static void main(String[] args)
- {
- if (args.length == 0){
- System.out.println("Errore: nessuna stringa in input");
- }
- else {
- String maxString = "";
- for(int i=0;i<args.length;i++){
- if (maxString.length()<args[i].length()){
- maxString=args[i];}
- }
- System.out.println("la stringa piu' lunga e' "+ maxString);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement