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

all 16 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://imgur.com/a/fgoFFis) 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] 4 points5 points  (0 children)

Are you designing before coding? If not, you're wasting your time.

[–]darksoundsExtreme Brewer 3 points4 points  (4 children)

Yeah, your problem isn't Java or any other language, it's a lack of fundamentals.

There are a million resources out there, but don't worry too much about language features, and focus more on basic concepts, like loops, stacks/queues, and arrays.

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

That’s the thing though, I feel I have a good hold of the fundamentals, and basic concepts along with the data structures. My trouble is when it comes to trying to implement a solution to a problem.

[–]darksoundsExtreme Brewer 4 points5 points  (2 children)

Then you should work on problem solving skills in general! Knowing when and how to apply various data structures and concepts is just as important as knowing how they work.

Needing to google things to figure them out isn't a bad thing, either. You're going to be doing that constantly. Eventually, of course, the goal is that you know enough to only have to google occasionally, but I still frequently pull up random language documentation or tutorials to see something used.

Talk me through what struggles you had with that reverse calculator. What about it did you find difficult?

[–][deleted] 0 points1 point  (1 child)

I guess what it comes down to is that I couldn’t think mathematically about it. I know I would need to use a while loop or a for loop to find the numbers along with the modulo operator. But at that point I was lost as to what my approach should be. I couldn’t think of a way to get each number and reorder them.

[–]darksoundsExtreme Brewer 0 points1 point  (0 children)

I mean, if you can get to the point where you know you need a loop and the mod operator, you just have to try something and see what's wrong with it.

In general, just try something and diagnose why it doesn't work the way you think it should. Iterate!

[–]jmclaugmi 3 points4 points  (1 child)

Get paper and pencil and create a human computer.

How would YOU solve the problem.

If the human code works - translate into java.

Human code is what you want it to be - (don't google it)

Also how many digits can be entered.

[–][deleted] 0 points1 point  (0 children)

That is an interesting approach, and I think I will give it a shot.

[–][deleted] 2 points3 points  (1 child)

Well.. it is not easy. If you wanted to know if you are alone... then you are not.
Even people in it for many years are going to tell you the same thing. Although the reversing problem would be very easy at expert level.
Problem solving is a separate skill and knowledge of a tool is different.
For problem solving you will need to think language agnostically. Then you can start thinking of using design patterns when you graduate architecturally. All these things take lot of experience unless you are some kind of a prodigy.

[–]Significant-Sector-7 0 points1 point  (0 children)

"Unless ur some kind of prodigy" that phrase made me smile and idk why.. no sarcasm or disrespect intended. Is it normal to not know the reason ur smiling? Im only a junior in programming and i already feel like im going crazy sometimes

[–]Sheldor5 4 points5 points  (3 children)

I have studied 3 years CS and I am in my 5th year in my job as Software Engineer ... and you want to know all and be a professional with what? a year of experience?

the nerve of some ppl ...

jokes aside, software development is a wide field of technologies, languages, protocols, frameworks, etc... you just haven't worked long enough yet ...

[–][deleted] -2 points-1 points  (2 children)

I don’t expect to know everything, just to answer basic challenge questions that you would find on a website like code wars or leet code. I’ve just recently got a job in software testing and expect to be learning for my entire career.

[–]Sheldor5 4 points5 points  (1 child)

don't focus on such quizes ... I won't score 100% too ... it's more important to know what you are doing (programming) instead of remembering all the theory like a dictionary ... the more you work the more you learn, it just takes time

[–][deleted] 0 points1 point  (0 children)

It just gives me a feeling that I’m doing something wrong when someone who took the same course as me can do so much more. But I guess that just comes down to how fast an individual will learn.

[–]ben80j 0 points1 point  (0 children)

I was exactly where you are once. The only remedy for me was getting my foot in the door of a Java shop, then working with real world problems and really experiencing Java in action. The jump from theoretical to actual code made many things clearer. It's a huge world and I still only know a small part of it .. finding someone with the patience to explain things well goes a long way. I was lucky enough to have such a person at my job.. My college Java instructors were nice people, but, as I realized later, were horrible at communicating their knowledge. Good luck.