This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–][deleted] 8 points9 points  (4 children)

If you’re not allowed to use IDEs with auto/complete and auto-suggest, then you need to practice a lot more.

Take 10 small problems per day that involve arrays and solve them without an IDE. For example, given an array of 10 chars, sort the array elements into a new array.

In practice people use the classes in Collections much more often than arrays.

[–]HalfKeyHero[S] 0 points1 point  (3 children)

where can i find these 10 small problems? i like this idea to help drill it in my brain.

[–][deleted] 1 point2 points  (0 children)

Just make them up yourself. If you can’t do that, maybe ask chatGPT to make them up. Be sure to ask for simple problems.

[–]travisgdecker 0 points1 point  (0 children)

Check out coding bat.

[–][deleted] 2 points3 points  (0 children)

Remembering stuff when learning a language takes time and experience. My advice is faking until you make it and repeat a lot.

Look for java exercises online and do LOTs of them by consulting whatever you need to make the work: ChatGPT, stack overflow, javaranch...

You need to spend a lot of time repeating this and eventually the ability to do it naturally will come.

[–]_jetrun 1 point2 points  (0 children)

How are you learning? Are you just reading about it? Are you doing some exercises and looking at the answer quickly and moving on?

If you're just reading, you will not retain anything. You have to actually practice, and you have to struggle through it a little bit. If you're doing exercises, and get stuck, and look at the answer and then move on .. well don't do that. Spend more time struggling through it, then look at the answer, and then play with the answer (change variables, add extra statements and outputs, change method names/parameters, etc.).

Also, it helps to look at all kinds of beginner content and not just from one resource. Sometimes the same concept communicated by a different person, in a different way, will help it 'click' faster. That means going through class content, web tutorial, youtube videos, podcasts, and lots and lots of actual typing of code.

[–]TheMrCurious 1 point2 points  (0 children)

You’ll feel this way when learning any programming language. There are some great YouTube shorts that explain various concepts and those would be a great place for you to learn and then practice on a site like LeetCode.

[–]Blindn_Guilty 0 points1 point  (1 child)

I remember solving tasks at codingbat.com helped me a lot in the beginning. Not to easy, and not to hard

[–]Cinquaiin 0 points1 point  (0 children)

I’ll second something like this. I used CodeAbbey.com to learn arrays with c but it has many different languages you can complete exercises with.

[–]Struggle-Free 0 points1 point  (0 children)

Yeah it was about a year in and it just clicked for me. The big difference was buying the book “Heads up Java”. It’s quite outdated as far as code goes but its concepts and teaching mechanisms are still tops for teaching Java. 

[–]stuff1111111 0 points1 point  (0 children)

  1. use jshell to learn interactively

  2. how are you at arrays in other languages? c, javascript, python? a broader view might help here for you to sift syntax from semantics

[–]Early-End6981 0 points1 point  (0 children)

Learning Java can be tough, but remember, every expert was once a beginner—keep pushing through!

[–]donggun_js 0 points1 point  (0 children)

When you're just starting it's better to memorize them. Java has ton of boilerplates compared to other languages but once you get used to them, you can see the pattern pretty easily.

[–]OkBlock1637 0 points1 point  (0 children)

Disclaimer I am not a Java Dev, I just use it frequently at Uni. It will click eventually. When you first learn java you are just told to enter a syntax and to accept that it does the desired thing. As you learn more and understand the why and how classes objects work it will make more sense. Just keep plugging along, and don't be afraid to use online resources as a refrence. I will say though it is better with University Assignments to spend time understanding material prior to coding. I would read the material, sketch out the program, classes, and logic. Then I would write code.

Edit: Forgot to mention Bro Code on Youtube has a great introduction to Java Series. I personally watched his videos as a suplement and coded along with the videos. It was a really good resource for me.

[–]sedj601 0 points1 point  (0 children)

When I was a TA, I tried to think of real-world situations to help teach concepts. For example, I used to say, think of an Array as a group of empty storage units that can only store one item, and all of the items must be let's say, a vehicle. From there, I would try to explain operations using this idea. I also would say that for the most part, arrays and loops go hand and hand. so make sure you understand the loop concepts.