presentation10-BENDZ - Samples Soheil Hassas Yeganeh...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Samples Soheil Hassas Yeganeh Computer Engineering Department Sharif University of Technology What is the output of the following programs? (They may have errors.) 1 st Example 3 Shape.java class Shape { Shape(){ System.out.println(“A shape is created.”); } } Circle.java class Circle extends Shape { public static void main(String args){ new Circle(); } } 2 nd Example 4 Shape.java class Shape { Shape(){ System.out.println(“A shape is created.”); } } Circle.java class Circle extends Shape { Circle() { System.out.println(“A circle is created”); } public static void main(String args){new Circle();} } 3 rd Example 5 Shape.java class Shape { Shape(){ System.out.println(“A shape is created.”); } public static void main(String args){new Circle();} } Circle.java class Circle extends Shape { Circle() { System.out.println(“A circle is created.”); } } 4 th Example 6 Shape.java class Shape { boolean shapeIsCalled; Shape(){ shapeIsCalled = true; System.out.println(“A shape is created.”); } public static void main(String args){new Circle();}...
View Full Document

Page1 / 17

presentation10-BENDZ - Samples Soheil Hassas Yeganeh...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online