How we Create and access class??
Class is a part of program it contains fields or variables and methods. Class are written in Computer Programs, that programming languages which are used to written classes are called Object Oriented Programming languages.
Classes are declared by using a keyword called "class".
For example:
- Public Class Area;
- {
- Public int length;
- Public int breath;
- Public double Area ();
- {
- Return Area=length*Breath;
- }
- }
If we use class fields and method in program then we want to initialize it first.
- Circle c;
- c = new Circle ();
OR
- Circle c = new Circle ();