Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hashmap Object  RSS feed

 
Bp Parker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have instructions telling me to create a hashmap object
called restaurantMenu. Well, i've finished the object & even
double checked it with the example to see if I misplaced any chars.

Error code i'm getting:
Restaurant.java:6: error: cannot find symbol
Hashmap restaurantMenu = new
^
symbol: class Hashmap
location: class Restaurant
Restaurant.java:7: error: cannot find symbol
Hashmap();
^
symbol: class Hashmap
location: class Restaurant
2 errors

 
Ryan Tracy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upper case the 'm'
 
Bp Parker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryan Tracy wrote:Upper case the 'm'


Thanks for quick reply, @Ryan Tracy.
 
Ryan Tracy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Classes are case sensitive.
 
Campbell Ritchie
Marshal
Posts: 55707
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryan Tracy wrote:Classes are case sensitive.
But they still managed to produce a class name like Hashtable.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!