Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Q87 #6131

Open
kgoedert opened this issue Oct 1, 2023 · 7 comments
Open

Java Q87 #6131

kgoedert opened this issue Oct 1, 2023 · 7 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kgoedert
Copy link

kgoedert commented Oct 1, 2023

Isn't something missing in the code of this question?
Because as it is, I think the correct answer should be "The code does not compile", instead of "A runtime exception is thrown"

@Cretus-iosDev
Copy link
Contributor

Cretus-iosDev commented Oct 1, 2023

Hi @kgoedert what do you think about this?
issue in Line - sb.deleteCharAt(0).insert(0, "H")." World!";
correct way - The correct way to append a string to a StringBuilder in Java is to use the append method,
Like this - sb.deleteCharAt(0).insert(0, "H").append(" World!");

@kgoedert
Copy link
Author

kgoedert commented Oct 2, 2023

For me, now the code is correct and would be consistent with the answer marked as correct

@Ebazhanov Ebazhanov added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 4, 2023
@Rishabh-mikku
Copy link

can you please assign me this issue to solve as I have clearly understood the issue? Also I have a good knowledge in java.

@Rohxn16
Copy link
Contributor

Rohxn16 commented Oct 6, 2023

Hi, I have worked with java and I can solve this problem. I will take a look into this.

@Rohxn16
Copy link
Contributor

Rohxn16 commented Oct 6, 2023

@kgoedert can u please take a look into this pr and merge this if possible

@c99SRS
Copy link
Contributor

c99SRS commented Oct 15, 2023

@kgoedert I have pretty much experience in Java. can I work on this?

@parthasdey2304
Copy link
Contributor

This is has got merged! So its better to close it to stop creating confusions!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants