What a Java program looks like
 

Things you find in a Java program:   (1) variables and (2) methods

 
 

Statements are (always) inside a method !!!

Java is an Object Oriented Programming Language
 

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

Structure of a C program

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
  {
     ...
  }
  

What a C program looks like
 

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 Language (no "limiting qualifiers")
 

C is not an Object Oriented Programming (OOP) Languages:

 
 

All global variables and all functions can be used (= accessed) by statements in any function !

Comment: later addition to the C programming language
 

  • Later, C has added:

      • static global variables    

  • static global variables are only accessible within the same C program file

    (C took some protection ideas from OOP....)