class student
{
//member variable
double marks1;
double marks2;
double marks3;
double average;
//member methods
void average( )
{
avg=(marks1+marks2+marks3)/3;
}
}
class demo
{
public static void main(String args[])
{
student obj1= new student( ); //object1 is created
student obj2= new student( ); //object2 is created
student obj3= new student( ); //object3 is created
//Assign value for student 1
obj1. marks1 =36.5;
obj1. marks2 =43.5;
obj1. marks3 =56.7;
//Assign value for student 2
obj2. marks1 =38.5;
obj2. marks2 =72.5;
obj2. marks3 =67.5;
//Assign value for student 3
obj3. marks1 =76.8;
obj3. marks2 =80.5;
obj3. marks3 =46.5;

System.out.println(“student 1:”);
obj1.average( );
System.out.println(“Student 2:”);
obj2.average( );
System.out.println(“student 3:”);
obj3.average( );
}
}

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 Initralise objectes of the class.

 

 

 

 

 

 

 

 

 

                                                                                                                                          

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