Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why cant I do this?  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
author
Marshal
Posts: 23438
138
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why can't you do what?!?

Took your code snippet. Placed it in a Dog class. Added a name field. Compiled and ran fine.

Henry
 
Author and ninkuma
Marshal
Posts: 66540
160
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags.
 
Marshal
Posts: 58414
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Please UseCodeTags.

Since he's new I shall add code tags.

And welcome to the Ranch
 
Henry Wong
author
Marshal
Posts: 23438
138
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

And with the code tags, I also realized that I fixed the main() method, by adding a close brace, too.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!