Course Solutions Uncategorized (Solved) : 1 Need Inheritence Programe 2 Set Point 3 Public Class Point 4 5 Private Int X 6 Private I Q27561544 . . . .

(Solved) : 1 Need Inheritence Programe 2 Set Point 3 Public Class Point 4 5 Private Int X 6 Private I Q27561544 . . . .

 

1 // I NEED INHERITENCE THIS PROGRAME
2 // THIS IS SET POINT
3 public class Point
4 {
5 private int x;
6 private int y;
7
8 // Constructor
9 Point()
10 {
11 setPoint(0, 0);
12 }
13
14 // Construtor with parameters
15 public Point(int x, int y)
16 {
17 setPoint(x, y);
18 }
19
20 public void setPoint(int x, int y) // To set points
21 {
22 this.x = x;
23 this.y = y;
24 }
25
26 int getXPoint()
27 {
28 return this.x;
29 }
30
31 int getYPoint()
32 {
33 return this.y;
34 }
35
36 public void displayPoint()
37 {
38 System.out.println(” Point x is: ” + getXPoint() + “Point y is:” + getYPoint());
39 }
40
41
42 }

// THIS IS DEMO1 CIRCLE

1 public class Circle extends Point
2

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post