This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

error pg 89 of K&b 5.0 study guide

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
// polymorphism example
class GameShape
{
public void diplayShape()
{
System.out.println("displaying shape");
}
}

class PlayerPiece extends GameShape
{

}

class TilePiece extends GameShape
{

}


public class TestShapes
{
public static void main(String[] args)
{
PlayerPiece player = new PlayerPiece();
TilePiece tile = new TilePiece();
doShapes(player);
doShapes(tile);
}

public static void doShapes(GameShape shape)
{
shape.displayShape(); //error--> cannot find symbol shape
}
}
 
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Namit Puri posted October 18, 2006 05:06 AM





Yours,
Bu.
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change diplayShape() to displayShape() or vice-versa.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To Namit,
It would also be a good idea to tell the correct error, it's displayShape() that cannot be found, not shape.
 
Namit Puri
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ankit.
Should have typed properly.
 
author
Posts: 9000
19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have my errata list with me, but I'm pretty sure someone found this error a week or two ago - it's on the list!

Thanks,

Bert
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bert,

Is this errata list final or do you have any updates to these.
[ October 18, 2006: Message edited by: Venkat Sidh ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic