>>59979761
I don't hate java, but I don't particularly enjoy it either.
Because people here don't work
All entry-level jobs are in webdev now.
>>59979761
because java is too complicated, using dynamically typed languages and no objects is so much easier
I still love you
>>59979761
I never loved you
>>59979971
>because java is too complicated
Nigga you crazy.
>>59979761
It was a one time fling. I found a new girl.
I hope we can still be friends.
https://pastebin.com/87bdsd1r
this is why
Because unlike your language, the VM implementations you're running on are inherently unsafe.
>>59980138
Why didn't you just push chars to stack and then pop onto a new string?
Don't blame Java for your own retardation.
>>59980210
Not my solution. That's the "proper" solution to the problem on leetcode
S-L-O-W
>>59979761
java my love i will never leave you, i just use others sometimes not by my choice if i could just use you i would but others don't know who you are. or what you can do.
>>59979971
>using dynamically typed languages and no objects is so much easier
>>59979761
We don't hate you. We just hate Oracle.
>>59980239
Then explain why you're using a retarded solution that's not even yours to show that java is shit
>>59979761
If I wanted a heavy language with lots of conveniences, I'd use C#.
>>59985526
>with lots of conveniences
Are you talking about the same language?
>>59979761
I still love you in the sense that you give me money each month.
However, I do hate Larry Ellison, please stop seeing him behind me back.
>>59979761
I love you, but clojure is so pleasure... sorry.
>>59985553
C# with .NET holds your hand through everything. It's does what Java fucked up trying to do.
>>59979761
I never loved you, awful shit.
>>59985598
Oh no, I agree. C# is full of convenience. Java has none of it, Java is defined by its boilerplate.
>>59980138
jesus christ, have you ever looked at the String API? this isn't Java's fuck up - it's yours.public static String reverseWords2(String sentence) {
StringBuilder sb = new StringBuilder(sentence.length() + 1);
String[] words = sentence.split(" ");
for (int i = words.length - 1; i >= 0; i--) {
sb.append(words[i]).append(' ');
}
sb.setLength(sb.length() - 1); // Strip trailing space
return sb.toString();
}
Yes, still not a succinct as the Python version, but performance is better I guarantee. and plus if all you're going to be doing is reversing words, then you'd be using Python anyway. As part of a larger application the above solution isn't bad.
>>59980239
https://leetcode.com/problems/reverse-words-in-a-string/#/solutions
I checked anon. I'm not seeing your solution anywhere. There is no editorial solution, and all the top Java solutions are highly optimized < 5 line solutions. Here is one -public String reverseWords(String s) {
String[] words = s.trim().split(" +");
Collections.reverse(Arrays.asList(words));
return String.join(" ", words);
}
pretty fucking sad you have to make shit up and build a strawman because you hate Java this much.
>>59985489
>>59985975
>>59980239
B T F O
>>59979761
Forced use of feature like exceptions
C++'s operator overloading is comfy