• Order
  • S$
  • Offers
  • Support
    • Due to unforeseen circumstances, our phone line will be unavailable from 5pm to 9pm GMT on Thursday, 28th March. Please be assured that orders will continue to be processed as usual during this period. For any queries, you can still contact us through your customer portal, where our team will be ready to assist you.

      March 28, 2024

  • Sign In

Disclaimer: This is an example of a student written essay.
Click here for sample essays written by our professional writers.

Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of UKEssays.com.

History and Development of Programming Languages

Paper Type: Free Essay Subject: Computer Science
Wordcount: 3494 words Published: 26th Mar 2018

Reference this

Yash Ojha

 

Introduction

Programming languages play the most important role in the creation of various Software’s. Application, and Webpages etc. Just because of the existence of programming languages today everything related to New Technology is possible. For example the various Social Networking sites that we use is a result of Programming Language, the Mobile phones that we use in our daily life is a brilliant outcome of programming as every IC in the circuit of the mobile phones are programmed due to which it works.

The most important outcome of Programming Language is the creation of Operating Systems (OS). OS is something without which we cannot use our PC’s or Laptop’s or even our mobile phones. OS acts as a base for every single function of a device to work in short it provides an important platform for the working.

If no programming languages were introduced then today it nearly impossible for the people to use computers, mobile phones, servers, and various other things. But thanks to the developers of the various types of Languages that made peoples life very easy and mobile.

1

All about JAVA!

Java was developed by James Gosling at Sun Microsystems in 1992 and was officially released in 1995. JAVA Technology is a programming language that is used for meeting the objectives of current challenges and opportunities in the present computing realm.

Java Virtual Machine (JVM): JVM is an Interpreter for JAVA programming language,  i.e., it is the only way to convert a Byte Code into machine language. The Byte Code cannot be converted using any technique other than the JVM. Therefore as I said above Byte Code somehow helps Java in being secure.

Java Runtime Environment (JRE): We all know that that the major problem with the programming languages before JAVA was platform dependency i.e., if we want to run the code compiled in Windows Xp in Linux, this was not possible as for that we need a special compiler which works in Linux only. So to solve this problem JRE was launched and became a part of java. Every Operating System have some mandatory files that are needed to run java on that particular OS. So in short JRE in the collection of all those mandatory files needed to run java on various OS’s plus JVM.

Due to JRE today it is possible to use the code written in some OS in any other OS.

So JRE made JAVA completely PLATFORM INDEPENDENT.

The byte code is loaded into JVM using the Class Loader.

JIT (Just in Time): JIT works as a verifier. It verifies the Byte Code first whether it is infected or not or whether it is holding some kind of virus in it or not. If found clean it forwards the Byte Code to the JVM for further process.

JIT is completely responsible for the SECURITY of JAVA.

Let’s see the whole process graphically.

A.java A.class

2

Now I’ll show you a basic program in java with its output.

class Sample

{

public static void main(String…s)

{

System.out.println(“Hello World”);

}

}

Let’s talk about the main() function.

The main function is made up of 5 things.

Access Specifier Function Name

public static void main() Parentheses

Access Modifier Return Type

Java Fundamentals

All programming languages have its own syntax and reserved keywords. JAVA also has these kind of language fundamentals. 

Basic fundamentals of java includes:

  • Java Keywords
  • Data Types
  • Legal and Illegal Identifiers
  • Operators

Let’s see every fundamental in detail.

  1. Java Keywords: Keywords are the words that convey special meaning to the language compiler. These are reserved for special purposes and must not be used as normal identifier names.
  1. Data Types: Data types are keywords are means to identify the type of data and how much memory a variable needs to carry out a particular operation.

Data types are divided into two types:

  • Primitive Data Types (8 types)
  • Non Primitive Data Types (User Defined 3 types)
  1. Legal and Illegal Identifiers: Identifiers are building blocks of a program and are used as the general terminology for the names given to different parts of the program viz. variables, objects, classes, function, arrays etc.

3

  1. Operators: The operations being carried out are represented by operators. The operations (specific tasks) are represented by operators and the objects of the operation are referred as operands

Classes in JAVA

Class is a collection of objects of similar types of objects. Objects are nothing but a buffer or an area and are defined by something which have some property and behaviour.

In java objects are created in the HEAP Memory inside the Java Virtual Machine.

Syntax for creating an object in java:

Class name object name=new class name();

new is a keyword of java which when used creates an object in the HEAP. Now whenever we use the new keyword a space in created in the HEAP memory inside the JVM for the object at runtime.

When we print the reference variable of some class then it prints 3 things:

  1. Class name
  2. “@” symbol
  3. Hash code

Graphical representation of HEAP and other memory areas available inside the JVM.

4

Principal of Object Oriented Programming (OOP)

The object oriented programming has been developed with a view to overcome the draw backs of conventional programming approaches. The OOP approach is based on certain concepts that helps it to attain its goal of overcoming the drawbacks of conventional programming approaches. There are 4 general concepts of OOP:

  1. Polymorphism
  2. Inheritance
  3. Abstraction
  4. Encapsulation (it’s a part of abstraction)
  • Polymorphism: It is the ability for a message or data to be processed in more than one form or it can simply be defined as one name used for many tasks which is used to speed up the compilation time.
  • Inheritance: This is a parent-child relationship between two classes. In this, the child class object inherits some properties of the parent class object.

Abstraction

Abstraction refers to the act of representing essential features without including the

background details or explanations.

Abstraction is divided into two parts:

  1. Abstract Class: Abstract class is used to define a rule.

Rules in abstract class:

  • All the task which we can perform in a normal java class can also be performed in an abstract class.
  • In abstract class we can define normal method as well as abstract methods.
  • It is not compulsory to have at least one abstract method in a class.
  • If a method is abstract then the class should be abstract.
  • We cannot instantiate (cannot create the object) of abstract class.
  • Abstraction is achieved using extends keyword.
  1. Interfaces: Interface are pure abstract methods. A class implements an interface, thus inheriting the abstract methods of an interface. An interface contains the behaviour that the class implements. The class that implements interface is abstract.

Syntax:

interface my;

{

declaration of methods;}

5

Rules in Interface:

  • We cannot instantiate of an interface.
  • Interface are used to define the rules purely.
  • All the methods of an interface are by default public and abstract.
  • In case of interface we use the keyword implements.
  • If we define any data member inside an interface than by default it becomes static

and final.

  • Interface is used to achieve Multiple Inheritance.

Packages

Packages is a collection of classes and interfaces. No class can exist without a package included in it. This is the rule of OOP’s. But when we open a class we don’t always make a package in that class, so in this case the rule of OOP’s is violated. So to avoid this problem JAVA has given a feature in its compiler due to which when we compile the program, the compiler automatically creates a package of the respective class during the compile time.

Command to compile the program with a package:

javac –d . p.java Name of the project

current directory is the same location as the class where the package is to be made.

Destination. –d . is called the switching tool.

Program with a package can be executed by using the Command:

Java .

Exception Handling

When any abnormal condition that comes in a code which can be handled then that situation is known as Exception Handling.

For every exception there are exception classes and exception methods to handle that exception in java by default.

We can easily handle these unwanted exceptions by using try and catch block.

Try is used to detect exceptions in a program and catch is used to handle that

The “finally” block: If an exception occurs in a program then the try and catch block will be executed and then the program terminates in normal condition. But in case of finally before the termination of program finally block also executes.

Syntax:

try{—-}

catch{—-}

finally{—-}

6

Threads

Every process is divided into two categories:

  • Heavy Weight Processes
  • Light Weight Processes

Heavy Weight Processes: These processes are those processes which stores a separate

area in RAM.

Light Weight Processes: These processes are those processes which occupy memory

under the heavy weight processes.

These light weight processes which occupy memory under the heavy weight processes

are known as Threads in JAVA.

Basically there are two ways in which we can make a thread:

  1. By directly implementing the runnable interface.
  2. By internally implementing the thread class in interface runnable and extending thread class.

Multithreading

Every part of a program is called a thread and every thread defines a separate path  of execution.

Java provides a building support for multithreading program. The multithreaded program contains two or more parts that execute concurrently.

Priority of which thread will start working first is decided by a program named as Thread  Scheduler which is a program of the Operating System. It gives the priority randomly.

Synchronization

To avoid the corruption of data we use the concept of synchronization in threads.

When we share a single object into multiple threads then the chance of data Corruption arises and to avoid this we need the concept of synchronization.

The keyword synchronized is applied on the function where the variables are assigned values. Due to the concept of synchronization only one thread executes at a time.

Input/Output Stream

Streams are nothing but a special type of buffer. In terms of JAVA streams are flow of bytes.

Benefits of I/O Stream:

  1. Execution time reduces.
  2. Performance Enhances.
  3. Network congestion chances reduces.
  4. We get bulk data at a time.

Streams are divided into two types:

  • High Level Stream
  • Low Level Stream

High level stream cannot be used alone, whenever we want to use a high level stream we have to connect it by a low level stream.

Stream

Byte Stream Character Stream

Console Based Unicode

Input Output Reader Writer

Stream Stream

Byte Stream

Input Stream Output Stream

  • FileInputStream FileOutputStream
  • BufferedInputStream BufferedOutputStream
  • DataInputStream DataOutputStream
  • ObjectInputStream ObjectOutputStream
  • ByteArrayInputStream ByteArrayOutputStream
  • PipedInputStream PipedOutputStream

8

Character Stream

`

Reader Writer

  • File Reader File Writer
  • Buffered Reader Buffered Writer

import java.io.*;

class Demo0

{

public static void main(String args[])

{

FileOutputStream fout=new FileOutputStream(“a.txt”);

PrintStream ps=new PrintStream(fout);

ps.println(“hello”);

ps.println(“hey”);

System.setOut(ps);

System.out.println(“m”);

}

}

This is a sample program of how to write a file by coding in JAVA.

Serialization

Serialization is the process using which we can convert an object into a stream. If we have to use an object only once and then we need to use the same object after a long time then we use the concept of serialization.

Features of Serialization:

  1. Only the object of that class can persist which implements serializable interface.
  2. If the parent class implements serializable interface then there is no need for child class to implement serializable.
  3. In case of serialization transient data members cannot persist.
  4. In case of serialization static data members cannot persist.
  5. Only the non-static data members can persist.

If we make any variable transient that means those variables are unwanted now and will get no memory in the HEAP inside the JVM.

Serializable interface is a type of marker interface. Marker interface are those interface which have no methods.

 

 

Cite This Work

To export a reference to this article please select a referencing stye below:

Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.

Related Services

View all

DMCA / Removal Request

If you are the original writer of this essay and no longer wish to have your work published on UKEssays.com then please: