Final tasks
Comments (48)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #10960894
1 April 2022, 09:10
In what way is 'Watermellon', 'Bob', 'Cherry', 'Apple' a sorted list of words? It is not alphabetical by start letter, it is not by string size either, yet it is used as an example of correct output for the last task?
+2
lakhenaleng
19 April 2022, 12:38
I believe the example output is incorrect - it should be:
Apple
22
Bob
3
Cherry
1
0
Watermelon
This output passed validation for me.
The words are being sorted with the String.compareTo method, which compares the strings based on the Unicode values of each of their characters. You can ctrl + left click on the methods in intelliJ to navigate to the method declaration and read more about its implementation.
+1
Anonymous #10853261
6 December 2021, 06:06
Note that on the task "List of number arrays", you need to add "import java.util.Arrays;" in order for the program to compile correctly because of the existing code in the printList method.
+4
Sean
19 August 2021, 22:12
Hey "The code won't compile".... that was a mean ';' you dropped in there.
+1
DarthGizka
30 May 2021, 17:17
task0919 (Dividing by zero) caveat: requirement 6 (The program should display the stack trace of the caught exception.) can only be met by calling a certain system-provided function for printing the stack trace or - maybe - by exactly imitating its output format.
0
John
2 May 2021, 10:48
i'm confuses with last task, can we compare a string and a number in string format using isGreaterThan() method?
0
Jonaskinny Java Developer at Sandmedia
24 February 2022, 02:52
You dont want to do that. You want to compare numbers to numbers, and strings as string.compareTo(string) because that is lexiconical (String(22) is < String(5))
0
The Chief
24 April 2021, 23:13
At least one of these tasks requires knowledge of certain things (e.g. StringBuffer) we haven't been taught yet. What's the reason behind that?
0
Justin Smith
21 July 2021, 21:59
Many tasks, especially the hard ones, will do this. You may have to google how to do something. This is encouraged. Professional programmers don't memorize everything, and they, too, have to look things up sometimes. It's a practice you should get used to.
+3
Rod Johnston Software Developer
4 April 2021, 05:53
Solved my problem - so frustrating.
I was able to make the code verify by NOT passing a parameter when I made the method call.
0
Rod Johnston Software Developer
4 April 2021, 05:40
Anybody else having trouble with verification on Task0919 - Divide by Zero. Verification messgage I get is
Code runs fine in IntelliJ.
0
Guanting LiuExpert
30 November 2020, 04:37
A scary fairy tale is really a mess,I heard this story but not the same stuff lol
0
Agent Smith
21 August 2020, 17:29
A scary fairy tale task uses this version:
Wolf ate granmother, then he ate red riding hood and was killed by a woodcutter.
How to work with SimpleDateFormat - read this article
+7
IsoVent
28 November 2020, 14:54
Brilliant article! Done in 20 mins; including reading.
+2