Java Programming Tutorial 6 - Getting User Input

0 liory dan · December 31, 2014
I am new to this stuff of java
I want to do Exactly like thenewboston video however I have problem with this 
here is what I did and the problem  I got 
I saw the Previous movies

Post a Reply


Oldest  Newest  Rating
0 Pere Garau Burguera · December 31, 2014
That's because Java is case sensitive. All classes in Java start with a capital letter, so you should put String, Scanner, System. 

Bucky doesn't follow this convention (he puts apples instead of Apples), but it's a thing everybody should do. 
0 Developer John · December 31, 2014
What I don't logically understand is why does the compiler compile the code correctly for him when he lower cased his class declaration? I get many questions referring to this. Not just classes are case sensitive in Java, but everything is. For multiple examples:

Real use: class Test                                                                Wrong use: class test
Real use: if                                                                Wrong use: iF
Real use: int                                                              Wrong use: Int
Real use: getCookies                                              Wrong use: GetCookies
Real use: int ILikeEggs                                                 Wrong use: int ILIKEEGGS or int ilikeeggs

Naming rules and conventions really matter in Java. They're just like real capitalization in real life, but about programming and making your code more correct and proper.
0 Pere Garau Burguera · December 31, 2014
Yeah John, Java is case sensitive everywhere.

You can name your class whatever you want, but since all the existing Java classes (String, System, Scanner) use the convention that the first letter has to be a capital letter, it's a good practice to follow that convention for the classes you create. That's why that line doesn't have an error, but the others (where he has to use Java classes) have the error because those classes doesn't exist (you could create them all lowercased if you wanted)
-1 Donald Trump · December 31, 2014
@Pere, name one programming language that isn't case sensitive :P
0 Developer John · December 31, 2014
Just to add a fine note to this conversation, remember to never name something that is a keyword, class, or even a method name in Java, yet doesn't have the same capitalization. You could really screw up your program.
0 Pere Garau Burguera · December 31, 2014
@TYPEX Yeah, not just Java but the majority of the languages (with some few exceptions) are case sensitive. 
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator