Encapsulation:
Encapsulation is a process of binding the data members and member functions into a single unit.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
public class Aperture
{
public Aperture ()
{
}
protected double height=10;
protected double width=20;
protected double thickness=30;
public double volume()
{
Double volume=height * width * thickness;
if (volume<0)
return 0;
return volume;
}
static void Main(string[] args)
{
Aperture obj = new Aperture();
Console.WriteLine( obj.volume());
Console.Read();
}
}
}
Encapsulation is a process of binding the data members and member functions into a single unit.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
public class Aperture
{
public Aperture ()
{
}
protected double height=10;
protected double width=20;
protected double thickness=30;
public double volume()
{
Double volume=height * width * thickness;
if (volume<0)
return 0;
return volume;
}
static void Main(string[] args)
{
Aperture obj = new Aperture();
Console.WriteLine( obj.volume());
Console.Read();
}
}
}
No comments:
Post a Comment