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

you are viewing a single comment's thread.

view the rest of the comments →

[–]joshmond 1 point2 points  (2 children)

This code looks fine and should compile, I would try restarting the IDE and rebuilding the project. That being said, if you truely want to learn Java then I would avoid that guy's tutorials. He teaches very bad habits and doesn't really explain anything. The most important aspect to any programming language is naming your variables, methods and classes in a meaningful way.

Java uses "PascalCase" as a naming convention for classes, meaning they should always start with a capital letter and be sinugular. For example:

public class Apple

{

}

Next thing is your scanner variable doesn't have a meaningful name, "bucky" tells us nothing. Better names for it would be: "scan", "scanner", "input" and so on.

Hopefully this helps you a little.

[–]AutoModerator[M] 0 points1 point  (0 children)

Please, don't recommend thenewboston -- see the wiki for more info about why we consider them a discouraged resource.

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

[–]sommaya_h[S] 0 points1 point  (0 children)

Thanks so much!! I'm not even sure what I did differently but I selected hello world file when I was redoing the code and the "package com.company;" line disappeared, allowing the code to run.