//the following is program code for the Rectangle class, which contains four constructors :
public class Rectangle {
public int width = 0;
public int height = 0;
public Point origin;

//Four constructors
public Rectangle() {
origin = new Point(0, 0);
}

public Rectangle(Point p) {
origin = p;
}

public Rectangle(int w, int h) {
this(new Point(0, 0), w, h);
}
public Rectangle(Point p, int w, int h) {
origin = p;
width = w;
height = h;
}

//A method for moving the rectangle
public void move(int x, int y) {
origin.x = x;
origin.y = y;
}
//A method for computing the area of the rectangle
public int area() {
return width * height;
}
}

Home      |      About Us      |     Portfolio      |      Services      |      Courses      |     Career      |      Cost      |      Contact Us
Services
  SEO   
  Link Building
  Data Entry
  Web Design and development
  Web Application development
 

Graphic and multimedia

  E-Commerce Solutions
  Software development
  Web Marketing & Promoting
  Internet Marketing
  IT Outsourcing
  Multimedia/CD Presentation
  Synopsis Ideas
  Project Ideas
  Placement Papers
  Live Project Training
  Programming & Projects
  Faq
  Training @balujalabs
 
 
Method
 

To demonstrate constructor Overloading

 

 

 

 

 

 

 

 

 

                                                                                                                                          

1

To demonstrate the classes in the java

2

To Find Average marks using classes

3 To Initralise objectes of the class.
4

To Find Factirial of animber Using Classes

5

To demonstrate dyamet Constmctor

6

To demonstrate Parameterixeal constructor

7

To demonstrate Copy Consfonctor

8

To demonstrate constructor Overloading

9 To find Average Of The Marts Of The Students
10 To Find Product Of Two Numbers using Default Constrnctor
11

To Find area of a triange Using argunernt Constrnctor