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

 

jebbert@volusia.k12.fl.us > quiz2023_09_15_APP1SLHL_firstCharacters
prev  |  next  |  chance

Write a method that returns a string made up of the first character in 'str1' followed by the first character in 'str2'. Either or both of these strings could be an empty string, in which case you indicate that with a "#" sign. For example, if 'str1' is "hello" and 'str2' is empty "", you would return "h#". If both strings are empty, you would return "##".


quiz2023_09_15_APP1SLHL_firstCharacters("this is a", "quiz") → "tq"
quiz2023_09_15_APP1SLHL_firstCharacters("Hello!", "") → "H#"
quiz2023_09_15_APP1SLHL_firstCharacters("", "") → "##"

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

public String quiz2023_09_15_APP1SLHL_firstCharacters(String str1, String str2) { }

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: 230

Copyright Nick Parlante 2017 - privacy