0% found this document useful (0 votes)
25 views

2 Programming Language Concepts

Uploaded by

Angelou Dogayo
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

2 Programming Language Concepts

Uploaded by

Angelou Dogayo
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Introduction to

Computer Programming
Programming Language Concept
Programming Language Concept
• Memory is the electronic holding place for
the instructions and data a computer
needs to reach quickly
• The CPU interprets, processes and
executes instructions, most often from the
hardware and software programs running
on the device.
• An input/output device is any hardware
used by a human operator or other
systems to communicate with a computer.
Programming Language Concept
Java Programming Language
• Java is a class-based, object-oriented programming
language that is designed to have as few
implementation dependencies as possible.
• It is intended to let application developers write once,
and run anywhere (WORA), meaning that compiled
Java code can run on all platforms that support Java
without the need for recompilation.
Java Programming Language
• JAVA was developed at Sun Microsystems Inc in the
year 1995 and later acquired by Oracle Corporation.
• It is a programming language created in 1991. James
Gosling, Mike Sheridan, and Patrick Naughton, a
team of Sun engineers known as the Green team
initiated the Java language in 1991.
Java Programming Language
• The principles for creating java were simple, robust,
secured, high-performance, portable, multi-threaded,
interpreted, dynamic, etc.
• Currently, Java is used in mobile devices, internet
programming, games, e-business, etc.
Java Programming Language
Implementation of a Java application program involves a
following step. They include:
1. Creating the program
2. Compiling the program
3. Running the program
Java Terminology
• Java Virtual Machine(JVM): This is generally referred to
as JVM. There are three execution phases of a
program. They are written, compile and run the
program.
• The compilation is done by the JAVAC compiler which is
a primary Java compiler included in the Java
development kit (JDK). It takes the Java program as
input and generates bytecode as output.
Java Terminology
• Bytecode in the Development Process: As discussed,
the Javac compiler of JDK compiles the java source
code into bytecode so that it can be executed by JVM. It
is saved as .class file by the compiler.
• Java Development Kit(JDK): While we were using the
term JDK when we learn about bytecode and JVM. So,
as the name suggests, it is a complete Java
development kit that includes everything including
compiler, Java Runtime Environment (JRE), java
debuggers, java docs, etc.
Java Terminology
• Java Runtime Environment (JRE): JDK includes JRE.
JRE installation on our computers allows the java
program to run, however, we cannot compile it. JRE
includes a browser, JVM, applet support, and plugins.
For running the java program, a computer needs JRE.
• Garbage Collector: In Java, programmers can’t delete
the objects. To delete or recollect that memory JVM has
a program called Garbage Collector. Garbage Collectors
can recollect the objects that are not referenced. So
Java makes the life of a programmer easy by handling
memory management.
Java Terminology
• ClassPath: The classpath is the file path where the java
runtime and Java compiler look for .class files to load.
By default, JDK provides many libraries. If you want to
include external libraries they should be added to the
classpath.
Primary/Main Features of Java
• Platform Independent: Compiler converts source code
to bytecode and then the JVM executes the bytecode
generated by the compiler. This bytecode can run on
any platform be it Windows, Linux, or macOS which
means if we compile a program on Windows, then we
can run it on Linux and vice versa.
Primary/Main Features of Java
• Object-Oriented Programming Language: Organizing
the program in the terms of a collection of objects is a
way of object-oriented programming, each of which
represents an instance of the class.
The four main concepts of Object-Oriented programming
are:
• Abstraction
• Encapsulation
• Inheritance
• Polymorphism
Primary/Main Features of Java
• Simple: Java is one of the simple languages as it does
not have complex features like pointers, operator
overloading, multiple inheritances, and Explicit memory
allocation.
Primary/Main Features of Java
• Robust: Java language is robust which means reliable.
It is developed in such a way that it puts a lot of effort
into checking errors as early as possible, that is why the
java compiler is able to detect even those errors that are
not easy to detect by another programming language.
Primary/Main Features of Java
• Secure: In java, we don’t have pointers, so we cannot
access out-of-bound arrays i.e it shows
ArrayIndexOutOfBound Exception if we try to do so.
That’s why several security flaws like stack corruption or
buffer overflow are impossible to exploit in Java.
Primary/Main Features of Java
• Distributed: We can create distributed applications
using the java programming language. Remote Method
Invocation and Enterprise Java Beans are used for
creating distributed applications in java.
Primary/Main Features of Java
• Multithreading: Java supports multithreading. It is a
Java feature that allows concurrent execution of two or
more parts of a program for maximum utilization of the
CPU.
Primary/Main Features of Java
• Portable: As we know, java code written on one
machine can be run on another machine. The platform-
independent feature of java in which its platform-
independent bytecode can be taken to any platform for
execution makes java portable.
Primary/Main Features of Java
• High Performance: Java architecture is defined in such a way
that it reduces overhead during the runtime and at some times
java uses Just In Time (JIT) compiler where the compiler
compiles code on-demand basics where it only compiles those
methods that are called making applications to execute faster.
Primary/Main Features of Java
• Dynamic flexibility: Java being completely object-
oriented gives us the flexibility to add classes, new
methods to existing classes, and even create new
classes through sub-classes.
Primary/Main Features of Java
• Sandbox Execution: Java programs run in a separate
space that allows user to execute their applications
without affecting the underlying system with help of a
bytecode verifier.
Primary/Main Features of Java
• Write Once Run Anywhere: As discussed above java
application generates a ‘.class’ file that corresponds to
our applications(program) but contains code in binary
format.
Primary/Main Features of Java
• Power of compilation and interpretation: Most
languages are designed with the purpose of either they
are compiled language or they are interpreted language.

You might also like