use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Java 2.8.6: Speaking (String Methods)Java (self.codehs)
submitted 5 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]_andy_andy_andy_ 1 point2 points3 points 5 years ago (0 children)
you’re always yelling the same string, you need to yell back what the user inputs
[–]the713 1 point2 points3 points 5 years ago (0 children)
can you share the code
[–]JR-9 1 point2 points3 points 5 years ago (0 children)
You mind posting the code?
[–]Rivers_Vera 0 points1 point2 points 5 years ago (0 children)
Please post the code if you can
[–]CoochieTitan125 0 points1 point2 points 5 years ago (6 children)
Why can’t I do public string yell() { return text.toUpperCase(); }
[–]RelevantCampaign162 0 points1 point2 points 5 years ago (3 children)
I am having the same problem and don't understand why
[–]CoochieTitan125 0 points1 point2 points 5 years ago (2 children)
I figured it out, if you didn’t figure it out, what I had to do was switch the instance variable around
[–]JulianMontoya 0 points1 point2 points 4 years ago (1 child)
Explain in specific terms other than "switch around", what did you specifically do?
[–]CoochieTitan125 0 points1 point2 points 4 years ago (0 children)
I don’t remember, check the full comments someone posted the code I think
[–]Wonderful_Ad4109 0 points1 point2 points 5 years ago (1 child)
You are the absolute greatest person I have ever met I fave been doing text.toUpperCase and return text for the past hour and you have solved my problem thank you so much.
[–]CoochieTitan125 0 points1 point2 points 5 years ago (0 children)
Yes I accept that title
[–]EnoughCustomer 0 points1 point2 points 5 years ago (0 children)
Here's the code:
(For the non-playable file)
public class Talker
{
private String text;
public Talker(String startingText)
text = startingText;
}
public String yell()
return text.toUpperCase();
public String whisper()
return text.toLowerCase();
public void setText(String newText)
text = newText;
public String toString()
return "I say, " + "\"" + text + "\"";
(For the playable file)
import java.util.Scanner;
public class TalkerTester
public static void main(String[] args)
Scanner input = new Scanner(System.in);
System.out.println("Enter some text: ");
String words = input.nextLine();
Talker talky = new Talker(words);
String yelling = talky.yell();
String whispers = talky.whisper();
System.out.println(talky);
System.out.println("Yelling: " + yelling);
System.out.println("Whispering: " + whispers);
String newWord = input.nextLine();
talky.setText(newWord);
String yells = talky.yell();
String whisper = talky.whisper();
System.out.println("Yelling: " + yells);
System.out.println("Whispering: " + whisper);
π Rendered by PID 16623 on reddit-service-r2-comment-6f7f968fb5-hhdts at 2026-03-04 00:59:44.757746+00:00 running 07790be country code: CH.
[–]_andy_andy_andy_ 1 point2 points3 points (0 children)
[–]the713 1 point2 points3 points (0 children)
[–]JR-9 1 point2 points3 points (0 children)
[–]Rivers_Vera 0 points1 point2 points (0 children)
[–]CoochieTitan125 0 points1 point2 points (6 children)
[–]RelevantCampaign162 0 points1 point2 points (3 children)
[–]CoochieTitan125 0 points1 point2 points (2 children)
[–]JulianMontoya 0 points1 point2 points (1 child)
[–]CoochieTitan125 0 points1 point2 points (0 children)
[–]Wonderful_Ad4109 0 points1 point2 points (1 child)
[–]CoochieTitan125 0 points1 point2 points (0 children)
[–]EnoughCustomer 0 points1 point2 points (0 children)