I have just started trying to learn Java, and i am currently following a tutorial series on youtube(Java tutorial by Derek Banas) it seems like a good series so far! but i have been going along with him and typing it out, then afterwards replacing my copied code with his fully commented code and reading it over. Which is why im confused as to why it doesn't work! all the files are in the same folder but it wont let me create an object.


I realise im being a super noob right now, but please tell me what i've done to break it!

Recommended Answers

All 4 Replies


dont' worry, this is a common issue with learning Java :

Monster.Java should be called Monster.java.

Java is case sensitive, so when it tries to find the Monster.java file, it's failing due to the naming issue. Rename it to Monster.java and it should be fine. (You can right-click on the file to rename it in Eclipse).

commented: solved my problem +2

if you really are just starting, you are not doing yourself any favours of starting immediately with an IDE.

just start of with notepad(++) and the command prompt.
you'll learn how to code, rather than to follow auto-complete suggestions, and it'll be easier to learn to use online documentation (since you'll need it a bit more) and reading of compile/run time errors, since the IDE might hide all that for you.

a red line under a statement is easy to spot, but for beginners, usually the problem causing it is not.

@Ewald Horn: Ah! thank you very much, i was very carelss. Had imagined it was something i did to the code and didn't think to check!

@stultuske: thank you for the suggestions, I am using notepad++ as well as eclipse, and i'm copying from tutorials at the moment so auto-complete doesnt make a great deal of difference, if anything its very handy to see what else exists in a library.

@PWolf - don't worry, I've only made that mistake a few hundred times, you'll learn to double-check :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.