Guest User

Untitled

a guest
Jul 15th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public class Shape
  2. {
  3. public int shapeSize = 1;
  4. public virtual void Draw()
  5. {
  6. Console.WriteLine("Draw a shape");
  7. ShowShapeSize();
  8. }
  9.  
  10. private void ShowShapeSize()
  11. {
  12. Console.WriteLine(shapeSize);
  13.  
  14. }
  15. }
  16.  
  17. public class Circle : Shape
  18. {
  19. //Can't change value here of shapeSize here??
  20. public override void Draw()
  21. {
  22. shapeSize = 2;
  23. base.Draw();
  24. Console.WriteLine("Testing none override");
  25. }
  26.  
  27. }
Add Comment
Please, Sign In to add comment