Things you find in a Java program: (1) variables and (2) methods
Statements are (always) inside a method !!!
Object Oriented Programming (OOP) Languages has access modifiers to provide data encapsulation:
OOP (= a class) can restrict the access of certain members inside an object
A C language program looks like this:
int x; // Global variable definition
void func1(int x, double y) // Function definition
{
...
}
double func2(double a, double b) // Function definition
{
...
}
double y; // Global variable definition
int func3(double a, int b) // Function definition
{
...
}
|
Things you find in a C program: (1) variables and (2) methods
Statements are (always) inside a function !!!
C is not an Object Oriented Programming (OOP) Languages:
All global variables and all functions can be used (= accessed) by statements in any function !
|