r/javahelp • • 2d ago

Stupid

I'm currently learning in college for computer science and java programming is one of the classes I'm currently taking. The IDE we use is jgrasp and I've never felt more stupid in my life. The concepts are confusing and the exam is coming up soon. We're starting to touch on arrays and classes but I genuinely don't even know where to start. Could someone give me some guidance?

8 Upvotes

19 comments sorted by

•

u/AutoModerator 2d ago

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.

5

u/Dobby068 2d ago

How many hours you out into studying? Do you have a Java book about fundamentals ? You need one and you need to go through it page by page and do the assignment at the end of each chapter and type the code by hand, all if it. Do this for 6 months and if still in the dark, then programming is not for you.

8

u/suckeddit 2d ago

You're supposed to learn Java on a dial up telnet session using a vi text editor on a 14 inch terminal connected to a Sun Sparcstation where you have to type "stty erase %" to make the backspace button work and not spew garbage. Or have three telnet sessions for editing, compiling, and running.

8

u/GolfballDM 2d ago

As to why the above is necessary, it builds character.

2

u/YetMoreSpaceDust 2d ago

Besides the dial up and sun sparcstation part, you're inadvertently correct - the only way to actually make sense of Java (or any other programming language) is to strip it down to its core: source code files and executables, and only use the "helper" functionality once you understand what it's actually doing.

Use a text editor to create source code files and compile those using javac and run them using the JRE and then the "magic" that the IDE is doing will be very evident.

1

u/Prozilla6 15h ago

At my university, the exams that contain java exercises are all on paper.

3

u/Dedios1 2d ago

Never heard of JGrasp before but apparently it’s a plugin as well for major IDEs. The concept looks cool - it generates diagrams of your code so you can visually see what your code is doing.

Arrays are contiguous containers of memory. So rewriting an array in a specific spot is difficult which is where immutability (unchanging) comes from. Thats why it’s ideal to use StringBuilder in Java to build a string (which is essentially an array). Have you programmed in C?

Classes either have constructors or not (these are parameters needed to instantiate the class). You can always extend a class. Classes have methods that help the object (created from the class) to do stuff.

Main is where you instantiate all of the classes you created to run a program.

That’s the gist.

Study OOP programming and essentially Java is the way it’s implemented.

1

u/my5cent 2d ago

Think of it as a container to store information. Array is like a shopping basket that you assign how many pockets it is to have. Class, if it's new is how you define an object or existing objects defined by someone else like God or in programming some name in its documentations.

1

u/aqua_regis 2d ago

The sidebar right here in the subreddit has an entire section Learning Java with some great resources. -> MOOC

1

u/Maleficent-Bag-4850 2d ago

Find programs you can look at their code and copy that program to a new project and direct it. By doing so, you will understand how it works.

1

u/serge-mv 2d ago

Your class should have a recommended book. If you don't know where to start, that's would be the perfect place. Reading the assigned chapters and doing the problems at the end is how you learn this.

Now, if you've done the reading and done the problems and you still struggle, then ask more concrete questions.

1

u/JackTradesMasterNone 2d ago

Yup, I used it in college, too - it's a very dumb IDE for real software development but it's good for college to learn how to type proper syntax.

Feel free to DM me for specifics.

1

u/DoctorBaconite 2d ago

Buy the Head First Java or Head First OOP Design books. They break everything down really well.

1

u/winstontubbleton 1d ago

I learned on jgrasp in my first Java course as well. It’s absolutely a beginner IDE, it’ll be your rite of passage. In the next course up, we upgraded to intelliJ and it was a way better environment in comparison.

At the end of the day, Java is just not easy. Here is what got me through my associates degree as someone who previously thought they were incapable of mathematical concepts (ie logic of all kind) and chronically got the lowest scores of every grade growing up:

-W3Schools. As soon as you hit a snag on a new concept (such as those arrays and classes) go read their page on it, do the associated exercises, and really consider how it all comes into play, what it means for the main idea of your learning objective that week, ways you could put that concept to work.
-Alex Lee on YouTube. There are plenty of other channels out there, but he’s straightforward and upbeat about the challenge that Java can be.
-A book. Any book on object-oriented programming you like. If it’s in terms, a style and pace that works for you (you may want to run to your school’s library to test drive a few) rent it for the semester and summarize it into ideas that clarify the concepts even further for yourself.
-Classmates. If you know anyone in the class, schedule some study time together. Meet somewhere with your laptops and independently tackle that week’s homework in each others’ presence. When one of you is stuck, you can start thinking out loud and troubleshooting together. Learn from each others’ errors. The worst thing you can do when you feel like you’re spinning your wheels is isolating and beating yourself up. Work together, talk through things, and see that this programming language is intuitive for very, very few. Cheer each other on when your compilers stop giving you errors. Get a feel for what it is to work on a team.

Programming is hard. You are not stupid. You’re in the weeder class for it now. You’ll upgrade to a different IDE very soon and whatever it is will blow jgrasp out of the water. Don’t give up! Let your fear of not knowing— not learning —be stronger than your fear of trying. Commit yourself to the goal, figure out how you study best (as in, playing with the learning material in a variety of ways that help further make the concepts tangible and sensible to you) and find your people, whether it’s your instructor, classmates, or people here. You’re in the early stages of it now, so if it boils down to just plain not enjoying it/can’t picture yourself doing it as a career, then don’t take the next class up. You will still have learned something valuable at the end of the day, which is that it isn’t for you and you’ll be one step closer to whatever is for you. But if you do enjoy this in some way, and you do want to see what doors it could open for you, then don’t give up, and don’t beat yourself up in the process.

0

u/Elegant_Werewolf2145 2d ago

sameee broo videos of abdul bari help mee :)

-3

u/Ilikesmallthings2 2d ago

I saw a cool way of using ai to learn. Have it explain it in a way you can understand it. Relate it to something you have interest in.

0

u/[deleted] 2d ago

Why do people downvote it? AI indeed can be a good tool for explaining things.
Asking AI "why/how it works" helps you to learn. But asking "write this java code for me" teaches you nothing of course.