Hanna Roberts

Ranch Hand
+ Follow
since Feb 09, 2020
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
19
Given in last 30 days
9
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Hanna Roberts

so if it used .length on an array if something like {1,3,5,6} it would read it at 4 slots?
10 hours ago
So I've been seeing programs using .length or .length() and I was wondering what they do. I was looking in my book and I didn't see what it was. When I looked online what I got from it was that length() is used for strings and basically processes the number of strings or letters used. Is that correct? and does length() differ from length?
12 hours ago
sorry I missed that post because it was on the next page
2 days ago
This is what I had written



and I attached a picture of the error
2 days ago

Campbell Ritchie wrote:Why is line 8 different from what others have written?
Don't write System.out.println(""); Write System.out.println(); instead.



As I wrote before, it gave an error when I ran it when I changed it to that
3 days ago

Mark Ii wrote:

Hanna Roberts wrote:

Mark Ii wrote:. . .






You are welcome. You said my code almost works. Can you kindly please give situations where it does not work so that I can write you a better version of the code?



so the failed tests are shown in the picture I attached, I guess it has to do with the use of void instead of strings in your code?
3 days ago

Mark Ii wrote:. . .



Thank you, This code almost worked as well. The last two in my book fails though I'm not sure why. Thanks for your help though I appreciate it.
3 days ago

Junilu Lacar wrote:That looks about right. Does it pass the test?



Yes it works. Someone helped me with it and said it was that but I don't understand the logic behind it. Do you think you could try and explain how its working ?
4 days ago
so is this what y'all meant?

4 days ago
I don't get how I would do it without it. Im not understand how the StringBuilder would work
4 days ago

Junilu Lacar wrote:There should be NO System.out.print() or System.out.println() statements in the strPattern() method at all.



I think there is supposed to be because all the examples the professor gave me to help figure this code out used them.
5 days ago
also I don't know what a nested stream is
5 days ago

Campbell Ritchie wrote:In which case, I think I shall go back to my suggestion about a StringBuilder.You could use a StringJoiner with space as the middle text for each line and a further StrngJoiner with line end as the middles text to join all the lines into one. You don't need any start or end text.




I don't think im supposed to do that because its supposed to all be in that one method I was writing
5 days ago
also when I try to make the print statement empty it gives me an error
5 days ago

Campbell Ritchie wrote:. . .



Sorry I don't understand what you are recommending me do. And isn't a string what the others suggested for me to change it to tho?
5 days ago