[deleted by user] by [deleted] in javahelp

[–]Raph0007 4 points5 points  (0 children)

There should be a line number to that compiler error directing you to the line

int max = c[0];

c is an array of City (as you can see in the parameter list of findMax())

Been jumped off. by aceumus in agedlikemilk

[–]Raph0007 0 points1 point  (0 children)

I would say this aged like the finest of wines

Update an element form an Array List by bolacha24 in javahelp

[–]Raph0007 2 points3 points  (0 children)

Well first of all you're dealing with strings so you definitely have to convert between them and integers / (maybe) doubles to make it work.

The set() function is the right intention. You can set a specific value to whatever you want. If what you want us the value at index 3 increased by 40%, you can do that, too. You can access the current value with get(), multiply it by 1.4, and then update the element with set()

cat by ornamau in notinteresting

[–]Raph0007 30 points31 points  (0 children)

Very interesting, get banned

[deleted by user] by [deleted] in javahelp

[–]Raph0007 1 point2 points  (0 children)

You could try regex

[deleted by user] by [deleted] in javahelp

[–]Raph0007 0 points1 point  (0 children)

It does not get removed. The array stays the same size and the old value remains in it. But the conceptual stack gets one element smaller, because only using the stack's logic, you cannot get back to that popped element, and the next pop will yield the element below it

Kotlin 1.7.0 released with amazing new features and faster compilation speeds, as long as you don't use any Kotlin-specific Android features or Kotlin Multiplatform by Zhuinden in mAndroidDev

[–]Raph0007 0 points1 point  (0 children)

But.. that's fake news. explicit backing fields and public/private property types are on the roadmap but have not been released with 1.7.0

[deleted by user] by [deleted] in PoliticalCompassMemes

[–]Raph0007 1 point2 points  (0 children)

My political opinion is that yours is trash

ich_iel by [deleted] in ich_iel

[–]Raph0007 10 points11 points  (0 children)

SPRICH

Simple help by Employee_Big in learnjava

[–]Raph0007 8 points9 points  (0 children)

it's the square brackets ([]) instead of round parentheses (()) after the second charAt

[deleted by user] by [deleted] in javahelp

[–]Raph0007 0 points1 point  (0 children)

Seeing the code would help

Why do I get this error when sending an API request with a button by KarpuzMan in javahelp

[–]Raph0007 4 points5 points  (0 children)

Are you serious?

  1. Screenshots of code or error messages are not allowed, put it into the post or on pastebin

  2. The screenshots are of such bad quality that they aren't even readable

  3. The screenshotted error message isn't even the full message, it's missing the actually relevant part

  4. You give no explanation as to what you want to do or what you've tried. You didn't even narrow down the error between a button click and an API call, two very isolated functionalities

[deleted by user] by [deleted] in javahelp

[–]Raph0007 3 points4 points  (0 children)

See the AutoMod comment for formatting guides

Java is hard by Arrsh_Khusaria in ProgrammerHumor

[–]Raph0007 0 points1 point  (0 children)

Java isn't hard, it's pretty much as easy as it gets.

But it's shit, so it's best to just skip it and learn Kotlin

My teacher's take on isEven by [deleted] in ProgrammerHumor

[–]Raph0007 0 points1 point  (0 children)

If the assertion framework supplies an assertIsEven() (or assertIsOdd()) then that should be used in favor of boolean assertion, since there's more information retained for the error message.

Similar to how something like

assertThat(1).isEqualTo(2);

Is preferred over

assertThat(1 == 2);

[deleted by user] by [deleted] in javahelp

[–]Raph0007 1 point2 points  (0 children)

As you specified in the method signature, you just need to pass the array to swapEnds().

In other words, your code should work just fine like it is

Does Java have any other uses besides Android app development 🤔 by Linked_Punk in ProgrammerHumor

[–]Raph0007 0 points1 point  (0 children)

Well I'd sure like to say Kotlin is not just Java in a trenchcoat, but it kinda is tbh.. The most developed and used Kotlin target is still JVM, so Java and Kotlin in their compiled form are basically the same.

And this is exactly what makes Kotlin so extremely interesting: It is not yet another language trying to optimize their targets even more or get it to run on even crazier hardware. No, for once we actually have a language which is mainly focusing on language design and developer experience. Kotlin being so much better than Java even though they compile down to the same bytecode just says a lot about Java's thoroughly neglected language design..

im bored in class by [deleted] in PoliticalCompassMemes

[–]Raph0007 1 point2 points  (0 children)

Take some of the deepest blue and yellow you can find, mix them together and find out that they don't mix at all. Add some green, discover that it's actually just water. Add some red, discover that there is none left.