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

 

conCatInAlpha


Returns the concatenation of two strings in alphabetical order. If word1 comes before word2 alphabetically return word1 + word2, otherwise return word2 + word1. You will find compareTo() helpful in completing this function


conCatInAlpha("apple", "banana") → "applebanana"
conCatInAlpha("coconut", "banana") → "bananacoconut"
conCatInAlpha("apple", "apple") → "appleapple"

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

public String conCatInAlpha(String word1, String word2){ }

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: 212 Post-solution available

Copyright Nick Parlante 2017 - privacy