Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

burton helmick
burton helmick
2,853 Points

I'm lost in the course "java objects"

I completed the courses: Computer Basics How the Internet works How the Web Works Treehouse Club Mash Treehouse Club: CSS Treehouse Club: JavaScript Java Basics

During all of these I felt like I understood what to do and why stuff was happening. I filled in a lot of gaps in my knowledge which was helpful. It recommended "Java Objects" next. I am most of the way through and have no idea what is going on. The terminology is over my head, and I have no idea why I'm doing stuff. I have read a bunch on reddit eli5, the questions on each video, and re-watched most of it but it isn't helping.

So my question is: Is there a class between these that I missed?

A second question is there a way to see the teachers code short of jumping around the videos. Some times when I get stumped it's helpful to see what I've missed by looking at theirs.

Thanks

3 Answers

The Java Objects class can be so fast paced it seems like there should be an intermediate class, but it looks like you've already taken the only preceding course offering. It does look like Treehouse is releasing a refresh of the Java Objects course next month however, so maybe it will clear up some of your questions:

https://teamtreehouse.com/library/java-objects-refresh/upcoming

Some source for treehouse projects can be found on their GitHub, but following along in workspaces and re-watching videos (while extremely frustrating at times) is probably the best thing to do when you're just starting out. Even tedious stuff like hand writing getters and setters helps cement concepts in your mind.

https://github.com/treehouse-projects

If you have any specific terms or concepts that are tripping you up, put them in the comments here and I'll do my best to help!

burton helmick
burton helmick
2,853 Points

Thanks for your help. I'm hoping that the upcoming course falls between what I have taken because I am super lost. I completely restarted java objects and it isn't helping at all.

Their system doesn't have a restart option so since I was 3/4 finished before, anytime I stop it restarts me at the end. I have to figure out where I am and can't stop mid video which is really frustrating with a toddler and constant distractions.

I have followed word for word along in the workspace, which is hard because I can't find where to view the teachers code other than skimming the video until he shows it. I couldn't fix my errors so I completely deleted my code and started again but I still have an error. Even thought I only have like 3 lines of code and It looks identical to his from what I can tell.

Sorry to complain and rant. I am normally really good at this kind of stuff I have built my own websites with ease and felt like I was really getting it until starting objects and now nothing works or makes sense. I feel like he explains what to type but doesn't ever explain why. When he does it's "We'll cover that later" or in jargon that is above my head. I am reading ELI5 and googling constantly to keep up, but I feel like if they are teaching something I should be able to follow and even with all this I can't. I feel so lost I don't even know how to explain what is wrong.

now my error is:

Error: Main method not found in class PezDispenser, please define the main method a s:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

I felt the same exact way. Trust me, I actually posted about it myself. Here are a few things that helped me learn the terms and know why things do what when and where.

1: I ended up writing up "tests" for me stating what I should do in a vague sense so I didn't just "remember" the code, but I understood why. Here is some of the code challenge tests: Create a new public unchangeable number named "MAX_CHARACTERS" (upperCase meaning it's constant) equaling to 140. [I gave away the variable name since I can literally name it whatever I want.]

Answer: public static final int MAX_CHARACTERS = 140;

2: Write as many notes as you can. I usually have to pause the video, listen to Craig explain what he is doing and why, and write it into a note using /* */ which helps me dissect not just a block of code, but even just a line.

Example from Hangman: //Below: Static: Displays a dash for each letter that HASN'T been figured out. char display = '-';

3: I slowed things down. Java Basics was pretty simple and I breezed through it. I understood everything but once I got to Java Objects the lines of code you'd be writing would become longer with each video which was a lot to try and understand at once. So I just started slowing down, rewinding when I didn't understand something.

4: Use the "Rubber Duck" real life method. The Rubber Duck method is once you learn something, teach it to an inanimate object (Rubber Duck was what was used when the name was created). Teaching helps you retain, understand, and learn yourself. If you can teach yourself (or a rubber ducky) in a simple manner, then you understand it.

5: Don't be afraid to use GOOGLE! Even Craig uses it (mostly to just show us that Google and the Java website are both viable tools to use). I've read people on Reddit who have been programming for 5+ years still using google because they forget or don't fully grasp a concept, method, or what have you. I would google "indexOf() java code explained" and read the definition of it. Sure, Craig is a great teacher and he explains it, but going into even more detail and reading it to yourself can do you a ton of favors.

Don't give up. I almost did and I instantly regret even thinking about it because once I followed these steps, coding is still tough, but it's much more rewarding because I'm still using my brain and I'm retaining the information. You'll figure it out. This is just a wall you've hit but just smash through it!

burton helmick
burton helmick
2,853 Points

Thanks for the advise. I was taking notes but when we switch projects they stay behind so I started my own notes in notepad++.

I have completely restarted objects and deleted and restarted my workspace and I can't make it past the first run of the program (sorry if that's not the right term I'm new). I feel so frustrated starting over and still not being able to make it work. Plus I feel like their system is super unhelpful for beginners. It doesn't have a restart option so since I was 3/4 finished before, anytime I stop it restarts me at the end. I have to figure out where I am and can't stop mid video which is really frustrating with a toddler and constant distractions.

I have followed word for word along in the workspace, which is hard because I can't find where to view the teachers code other than skimming the video until he shows it. I couldn't fix my errors so I completely deleted my code and started again but I still have an error. Even thought I only have like 3 lines of code and It looks identical to his from what I can tell. I tried searching for the code on the gethub but it doesn't seem to have anything about the pez project.

now my error is:

Error: Main method not found in class PezDispenser, please define the main method a s: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application

Sorry to complain and rant. I am normally really good at this kind of stuff I have built my own websites with ease and felt like I was really getting it until starting objects and now nothing works or makes sense. I feel like he explains what to type but doesn't ever explain why. When he does it's "We'll cover that later" or in jargon that is above my head. I am reading ELI5 and googling constantly to keep up, but I feel like if they are teaching something I should be able to follow and even with all this I can't. I feel so lost I don't even know how to explain what is wrong.

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Burton,

If Java is what you wish to learn next, I would follow that Treehouse Track Learn Java. It is set up to progress systematically and slowly increase knowledge and understanding. According to this track, there is one course that comes before Java Objects.

Give that a try. Keep Coding! :dizzy: