Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes Why cant I do this? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why cant I do this?" Watch "Why cant I do this?" New topic
Author

Why cant I do this?

Isaiah Obi
Greenhorn

Joined: May 02, 2010
Posts: 1
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18914
    
  40


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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Please UseCodeTags.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Bear Bibeault wrote:Please UseCodeTags.
Since he's new I shall add code tags.

And welcome to the Ranch
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18914
    
  40


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

Henry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why cant I do this?