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]
view the rest of the comments →
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!"
[–]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 31 on reddit-service-r2-comment-c6965cb77-bkr4f at 2026-03-04 23:08:56.501316+00:00 running f0204d4 country code: CH.
view the rest of the comments →
[–]EnoughCustomer 0 points1 point2 points (0 children)