• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query

 
ajay_kumar_rana
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public abstract class Canine { public Bark speak(){};} Will it compile ? Why or Why not. For reference see page no. 74 question 2. Because when i am writing this code in eclipse it is showing error like Bark can't be resolved but Kathy ciera's book says that this is compilable.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"AjayKumarRana", you have previously been warned via private message regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff
 
ajay_kumar_rana
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
"AjayKumarRana", you have previously been warned via private message regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Is it okay sir.
Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please, put your new comments outside the quoted stuff. Otherwise it's very hard to read.

No, your name is not OK - but thank you for attempting to fix it. Underscores (the '_' character) are not acceptable as part of real names. Please use a space instead. Thanks.

As for your original question: "it is showing error" is not very helpful. What error are you seeing? Please copy and paste the text of the error message you see.

As for your original question, it seems obvious that the code you showed will not compile. Where in Kathy Sierra's book does it say otherwise?
 
Amod Mulay
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
id does not compile as it does not know what is the type "Bark". unless you have a class by the name of Bark and have imported in your abstract class it will not compile.. please go through the book properly befor commenting that it does not work.
the compiler has to understand the return type!!!
 
Amod Mulay
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
id does not compile as it does not know what is the type "Bark". unless you have a class by the name of Bark and have imported in your abstract class it will not compile.. please go through the book properly befor commenting that it does not work.
the compiler has to understand the return type!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic