Based on the style of programming the languages are divided into three types Procedure structure OOPL 1960’s A! GOL 1970’s
P1 Main ()
{
Int Sal = 4000;
Print f (“%d”, Sal);
}
Output:-
~- 700
Interested in mastering .NET? Learn more about ".NET Training" in this blog post.
The data type's limits are not controlled at run time.
P2 Main ()
{
Int I = 500 * 500/500;
Print f (“%d”, i);
}
Output:-
- 27
No proper implicit procedure for calculation
P3
Long Sal = 5000;
// global variable
Main ()
{}
Void F1()
{}
Void F2 ()
{}
Void Marketing Details ()
{
Long Sale = 500000; Sale = Sale + Sale ;
}
No Security for the ‘DATA’
When a language supports, the following oops concepts then that language is called an object-oriented programming language (OOPL).
As per.net, A class is a collection of
Instance means copy
Class C1 Name
{
Private int x,y;
Private String s;
Public void print ();
{
Return type
}
Private and public are assessed specifiers
which provides the scope of risibility
Test obj = new Test()
Note:-
Classes must be declared in GD only.
Classes Test
{
Private int x, y ;
// fields (or)
Reference types
Public void Read (int a, int b)
//a and b are value types,
local variables.
{
x =a;
y =b;
}
Public void print ()
{
Int K = x +y ;
Message Box >show (“The sum is ” + K);
}
//print
}
//test Code for Button 1
click
{
Test t1 = new Test () T1.Read (10,20);
T1.Print (10,20);
T1.Print ();
// output is ‘30’
Test t2 = new Test ();
T2.print ();
// output is ‘0’
Test t3 = new Test ();
T3.print ();
//error
Test t3 = t1;
T3.print ();
//output is ‘30’
}
Execute the project
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.