class Car {

String licensePlate = “”; // e.g. “New York 543 A23”
double speed = 0.0; // in kilometers per hour
double maxSpeed = 120.0; // in kilometers per hour

void floorIt( )
{
this.speed = this.maxSpeed;
}

void accelerate(double deltaV)
{
this.speed = this.speed + deltaV;
if (this.speed > this.maxSpeed) {
this.speed = this.maxSpeed;
}
if (this.speed < 0.0) {
this.speed = 0.0;
}

}

}

class CarTest4 {

public static void main(String[] args) {

Car c = new Car();

c.licensePlate = “New York A45 636”;
c.maxSpeed = 123.45;

System.out.println(c.licensePlate + “ is moving at “ + c.speed +
“ kilometers per hour.”);

for (int i = 0; i < 15; i++) {
c.accelerate(10.0);
System.out.println(c.licensePlate + “ is moving at “ + c.speed +
“ kilometers per hour.”);
}
}
}

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 Find Factirial of animber Using Classes

 

 

 

 

 

 

 

 

 

                                                                                                                                          

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