fork download
  1. using System;
  2.  
  3. public class Shape{
  4. public String name;
  5.  
  6. public abstract double area();
  7. }
  8.  
  9. public class Rectangle: Shape{
  10. private double width;
  11. private double height;
  12.  
  13. public Rectangle(String name, double width, double height){
  14. this.name = name;
  15. this.width = width;
  16. this.height;
  17. }
  18.  
  19. public double area(){
  20. rturn this.width * this.height);
  21. }
  22.  
  23. }
  24.  
  25. public class Test
  26. {
  27. public static void Main()
  28. {
  29. Rectangle r = new Rectgale("r", 10, 3);
  30.  
  31. Console.Writeln(r.name + "'s area is " + r.area());
  32. }
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(20,14): error CS1525: Unexpected symbol `this'
prog.cs(20,27): error CS1525: Unexpected symbol `this'
prog.cs(20,38): error CS1525: Unexpected symbol `)', expecting `;' or `}'
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty