BASIC, C, C++ and Java are popular examples of high-level languages.
Procedural Oriented Programming (POP)
POP allows the users to develop their logic by applying a number of functions that would enable program productivity.
In POP, the emphasis is on functions rather than on data.
POP uses a top-down approach of programming.
BASIC, COBOL, FORTRAN and C are Procedure Oriented Programming Languages.
Object Oriented Programming (OOP)
OOP follows a modular approach to standardize the program by creating a memory area for both data and functions.
In OOP, emphasis is on data rather than functions.
OOP uses a bottom-up approach of programming.
C++, Java, Python, Smalltalk, Ruby, Eiffel are Object Oriented Programming Languages.
It is a unique identity which contains data and functions together.
It is a template of objects. It contains common attributes and behavior.
Principles of OOP
It is the act of representing the essential features without knowing the background details.
It is about linking and sharing some common properties of one class with the other class. It lets us reuse code.
It is the process of using a function or method for more than one purpose. Function Overloading is an example of polymorphism.
It is the system of wrapping data and functions into a single unit.
Fill in the blanks:
- An act of using essential features without including background details is called data abstraction.
- In Object Oriented Programming, the stress is given on data.
- Wrapping of data and functions together as a single unit is called encapsulation.
- An object has unique identity through which it may differ with some characteristics and behavior.
- The objects may communicate with each other through functions.
- In POP, the global data is loosely attached to the functions.
- The process by which a class acquires the property of another class is known as inheritance.
- In Object Oriented Programming, using a function for many purposes is termed as polymorphism.
State whether True or False:
- A process according to which a class acquires the characteristics from another class is encapsulation. (FALSE)
- Procedure Oriented Program stresses on data. (FALSE)
- C++ is also an object-oriented programming language. (TRUE)
- A function is a set of objects that share common state and behavior. (FALSE)
- Encapsulation keeps data safe from outside interference. (TRUE)
Introduction to Java
Java is an object-oriented programming language. It was developed primarily by James Gosling at Sun Microsystems. The language was initially called Oak.
Java is a platform independent language. It has adopted many of its features from C++.
Basic Features of Java
- Java is an object-oriented programming language.
- It is both compiled and interpreted.
- It can access data from local system as well as from net.
- Java programs are written within classes.
- We can create applets using Java.
- Java doesn’t require any preprocessor.
- It is case-sensitive.
Compilers and Interpreters
A software that accepts the whole program in high level language and converts it into machine level language is known as a compiler.
A software that converts the high level instructions line by line to machine level language is known as an interpreter.
Compilers are usually faster than interpreters.
The program that the compiler uses for conversion is called source program or source code.
The machine language program that we get from the compiler is called object code.
Compilers are incapable of showing logical errors.
Compilers and interpreters are system software, and are together known as language processors.
Java compiler is a software that converts source code into intermediate binary form called bytecode. This bytecode is platform independent.
The Java interpreter converts bytecode into machine code. This Java interpreter is also known as JVM (Java Virtual Machine).
A package can be included in the program by using the keyword import.
java.lang is the default package in Java.
Java Reserved Words
Java reserved words or keywords are the words which carry special meaning to the Java compiler. They cannot be used for naming the variables.
Different Types of Java Programming
There are mainly two different platforms for writing Java programs:
- Java Application
- Java Applets
Java Application (Standalone System)
Java can be used to create standalone desktop applications.
Java Applets (Internet Applets)
It is a program that can be included in an HTML page.
JDK stands for Java Development Kit.
Write True or False:
- Java application is a Java program which is developed by users. (FALSE)
- James Gosling developed Java programming language. (TRUE)
- Machine codes are expressed using alphanumeric characters. (FALSE)
- Bytecode is the program in binary form. (TRUE)
- JVM is Java Visual Management. (FALSE)
Fill in the blanks:
- Java is a case-sensitive language.
- In Java, the package used to find power raised to any base is java.lang.
- The words which are preserved with the system are called reserved words, that cannot be used as variable names in Java programming.
- A single line comment is represented by the symbol // in Java programming.
- BlueJ is a window based platform to operate Java program.