Another great day, welcome back to insideimt.org.ng Today let talk more about programming with Java.

Table of contents

  • Introduction
  • Concepts of OOP
  • History of java
  • Heatures of Java
  • Comparison of java and C++
  • Java virtual machine
  • Java Environment



INTRODUCTION

   Welcome ones again to Insideimt today I will be teaching about Java.  Java is a high level, third generation programming language, like C, FORTRAN, SMALLTALK, PERL and many others. You can use Java to write computer application's that play games, store data or do any of the thousands of others thing's computer software can do. compared to other programming languages, Java is most similar to C. However although Java share much of C's syntax, it is not C. Knowing how to program in C or, better yet C++, will certainly help you to learn Java. A Java compiler won't compil C code, and most large C program's need to be changed substantially before they can become Java program. by  What's most special about Java is relation to other programming languages ID that  let's you write special programs called applets that can be downloaded from the internet and played safely within a web browser. Java language is called the Object-Oriented programming language and before beginning for Java, we have to learn the concept of OOPs (Object-Oriented programming).


CONCEPTS OF OOP

  There are some basic concept of object oriented programming as follows:

1. Object

2. Class

3. Data abstraction

4. Data encapsulation

5. Inheritance

6. Polymorphism

7. Dynamic binding


1. OBJECT

Object are important runtime entities in object-oriented method. They may characterize a location, a blank account, and a table of data or nay entry that the program must handle .


2. CLASS

 A class is a set of object with similar properties (attributes), common behavior (operations), and common link to other object. The complete set of data and code of an object can made a user defined data type with the help of class. The objects are available of type class. A class is a collection of objects a similar type. classes are user defined data type and work like the build in type of the programming language. Once the class has been defined, we can make any number of objects belonging to that class. Each object is related with the data of type class with which they are formed.

   As we learned that the classification of objects into various class is based on its properties (states) and behavior (methods). The important thing about the class is to identify the properties and procedures and applicability to it's instances.

The object develop their distinctiveness from the difference in their attribute value and relationship to other objects.


3. DATA ABSTRACTION

 Data abstraction refers to the act representing important description without including the background details or explanations. Classes use to concept of abstraction and are defined as a list of abtract attributes such as size, cost and functions operate on these attentions. They summarize all the important properties of the object the are to be created. Classes use the concept of data abstraction and it is called Abstraction Data Type (ADT).


4. DATA ENCAPSULATION

  Data encapsulation means wrapping of data and functions into a single unite (i.e. class). It is most useful features of class. the data is not easy to get to the outside world and only those functions which are enclosed in the class can access it. These functions provide the boundary between Objects data and program. This insulation of data from direct access by the program is called Data hiding.


5. INHERITANCE


Inheritance is the process by which Object of one class can get the properties of Object of another class. Inheritance means one class of Objects inheriting the data and behavior's from another class. Inheritance maintenance the hierarchical classification in which a class inherits from it's parents. Inheritance provides the important feature of OOP that is reusability. That means we can include additional characteristics to an existing class without modification. This is possible deriving a new class from existing one. In other words, it is property of Object-oriented systems that allows Objects to be built from other Objects. Inheritance allows openly taking help of the commonality of Object when constructing new class. Inheritance is a relationship between classes where one class is the parent class of another (derived) class. The derived class hold the properties and  behavior of base class in addition to the properties and behavior of derived class.


6. POLYMORPHISM

  (Poly means — many and Morph means — from). Polymorphism means the ability to take more than one from. Polymorphism plays a main role in allocation Objects having different internal structures to share the same external interface. This means that a general class of operation may be accessed in the same manner even through specific activities associated with each operation may differ. Polymorphism is broadly used in implementing inheritance. 

It means Objects that can take on or assume many different forms. Polymorphism means that the same operation may behave differently on different classes. Booch defines polymorphism as the relationship of objects many different classes by some common supper class. Polymorphism allows us to write generic, reusable code more easily, because we can specify general instructions and delegate the implementation detail to the Objects involved.


7. DYNAMIC BINDING

 Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding means that the code related with a given procedure call is not known until the time of the call at run time.


HISTORY OF JAVA

 Java is a general-purpose, Object-Oriented programming language developed by sun Microsystems of USA in 1991. originally called Oak by James Gosling (one of the investor of the language). Java was invented for the development of the software for consumer electronic devices like TVs, rosters Etc. The main aim had to make java simple, portable and reliable. Java Authors: James, Author Van, and others.


FEATURES OF JAVA

As we know that Java is an object oriented programming language developed by Sun Microsystems of USA in 1991. Java is first programming language which is not attached with any particular hardware or operating system. Program developer in Java can be expected anywhere and on any system.


Features of Java are as Follows:

1. Compiled and interpreted

2. PlatformIndependent and portable

3. Object-Oriented

4. Robust and secure

5. Distributed

6. Familiar, simple and small

7. Multithreaded and interactive

8. High performance

9. Dynamic and Extensible


1. COMPILED AND INTERPRETED

Basically a computer language is either compiled or interpreted Java comes together both these approach this making Java a two stage system. Java compiler translate Java code to Byte code instructions and Java interpreter generates machine code that can be  directly executed by machine that is running the Java program.


2. PLATFORM INDEPENDENT AND PORTABLE

Java supports the feature portability Java programs can be easily moved from one computer system to another and anywhere. Changes and upgrades in operating system, processing and system resources will not force any alteration in Java programs. This is reason why Java has become a trendy language for programming in internet which interconnects difference kind of system worldwide. Java certifies portability in two ways. First way is, Java compiler generates the bytes code and that can be executed on the machine. Second way is, size of primitive data types are machine independent.


3. OBJECT—ORIENTED

Java is truly Object-Oriented language. In Java, almost everything is an object. All program code and data exist in objects and classes. Java comes with an extensive set of classes; organized in packages that can be used in program by Inheritance. The Object model in Java is trouble-free and easy to enlarge.


4. Robust and secure

Java is a most strong language which provides many securities to make certain reliable code. It is designed as garbage-collected language, which helps the programmers virtually from all memory management problems. Java also includes the concept of exception handling, which detain serious errors and reduces all kind of threat of crashing the system. Security is an important features of Java and this is the strong reason that programmers use this language for programming of internet. The absence of pointers in Java ensures that programs cannot get right entry to memory location without proper approval.




5. DISTRIBUTED

Java is called a distributed language for construct application on networks which can contribute both data and programs. Java applications can open and access remote Objects on internet easily. that means multiple programmers at multiple remote locations can work together on single task.


6. SIMPLE AND SMALL

Java is very small and simple language. Java does  not use pointer and header files, go to statements,. It eliminates operator overloading and multiple inheritance.


7. MULTITHREADED AND INTERPRETED

Multithreaded means managing multiple task simultaneously, Java maintains multithreaded programs. That means we need not wait for the application to complete one tack before starting next task. This features is helpful for graphic applications.


8. HIGH PERFORMANCE

Java performance is very extraordinary for an interpreted language, majority due to the use of intermediate byte code. Java architecture is also designed to reduce overheads during runtime. The incorporation of multithreaded improves the execution speed of program.


9. DYNAMIC AND EXTENSIBLE

Java is also dynamic language. Java is capable of dynamically linking in new class, libraries, methods and Objects. Java can also establish the type of class through the query building it possible to either dynamically link or abort the program, depending on the reply. Java program is Support functions written in other language such as C and C++, known as native method.