id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

cynthia.gallatin@pisd.edu lab5a > longestString
prev  |  next  |  chance

Given three Strings, str1, str2 and str3, return the longest String. If all three Strings have the same length, return "same". There will not be a tie between two longest Strings.


longestString("apple", "banana", "pear") → "banana"
longestString("one", "two", "three") → "three"
longestString("bob", "jim", "joe") → "same"

...Save, Compile, Run (ctrl-enter)

public String longestString(String str1, String str2, String str3){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 175 Post-solution available

Copyright Nick Parlante 2017 - privacy