0% found this document useful (0 votes)
1 views7 pages

Core Java Notes

The document provides an overview of programming languages, classifying them into low-level (machine and assembly languages) and high-level languages, with a focus on Java. It details Java's features, applications across various domains, and the architecture of the Java Virtual Machine (JVM). Additionally, it covers the Java Development Kit (JDK), basic elements of Java programming, and naming conventions for identifiers and keywords.

Uploaded by

ashishbhosale707
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views7 pages

Core Java Notes

The document provides an overview of programming languages, classifying them into low-level (machine and assembly languages) and high-level languages, with a focus on Java. It details Java's features, applications across various domains, and the architecture of the Java Virtual Machine (JVM). Additionally, it covers the Java Development Kit (JDK), basic elements of Java programming, and naming conventions for identifiers and keywords.

Uploaded by

ashishbhosale707
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Program: It is a collection of Instructions used to solve a problem.

Programming: The art of writing a program is called programming.


Classification of Programming Languages:

Low-level languages:
1. They are easily understood by computers.
2. They are machine dependent languages.

Machine Language:
1. It is a first generation language.
2. Sequence of 1’s and 0’s form an instruction in machine language.
Example: 101010100011

Advantages:
1. It can be directly typed and executed.
2. No translator is required.
Disadvantages:
1. Difficult to remember machine instructions.
2. Difficult to understand, modify and remove errors.
3. Lack of portability.

Assembly Language:
1. It is a second generation programming language.
2. Symbolic words are used in this language called ‘Mnemonics’
Example: ADD for addition
SUB for subtraction
MUL for multiplication
DIV for division
Sample Program : Result = a+b
MOV a, 4
MOV b, 5
ADD a,b
MOV Result, a
Advantages:
1. Easy to remember
2. Easy to understand the program
3. Easy to write, modify and debug the program
Disadvantages:
1. Mnemonics are not standardized
2. Need of translator
3. Machine dependent

High level languages:


1. These are English like statements.
2. The elements of these languages are alphabets, digits, punctuation and special
symbols.
Example: Read a,b
Sum=a+b
Print Sum
Stop
Advantages:
1. Each and every instruction is easy to read and understand.
2. Instructions are machine independent.

3. General purpose high level languages are used in almost all the fields such as
teaching, training, business, art and science.
Example: BASIC, Pascal and C language
4. Specific purpose high level languages are restricted to particular fields.
Example: COBOL for business data processing, Fortran for scientific applications,
C++/JAVA/.NET for web application development, PROLOG/python/R for Artificial
Intelligence.

Introduction to Java:

1. Java was developed by James Gosling in 1995 at Sun Microsystems.


2. Later it was acquired by the Oracle company.
3. Java is a high level programming language.
4. Java makes writing, compiling and debugging programming easy.

Features of Java:

1. Simple: Java is one of the simple language as it does not have complex features like
pointers and explicit memory allocation.
2. Secure: Java programs run in an environment that is independent of the operating
system environment which makes java programs more secure.
3. Robust: It is reliable. Checking the errors will be much faster and the java compiler
detects those errors that are not easy to detect by another programming language. Java
is robust because of the features like Garbage collection, Exception handling and
Memory allocation.
4. Distributed: The java programs can be easily distributed on one or more systems that
are connected to each other through an internet connection.
5. Portable: Java code written on one machine can be run on another machine by
carrying the bytecode.
6. Object oriented: Java is an object oriented programming language. Everything in java
is an object. Basic concepts of OOPs are: Object, Class, Inheritance, Polymorphism,
Abstraction and Encapsulation.
7. Machine Independent: A language that can run on any machine is called Machine
Independent language. The JVM can take compiled code for any Java application and
run it on any machine.
8. Architectural Neutral: Java is architecture neutral because there are no
implementation dependent features. Example: the size of primitive types are almost
fixed.
9. 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. Java even supports functions written in other languages such as C, C++
which are referred to as native methods.
10. Multithreaded: thread is like a separate program, executing concurrently. We can
write Java programs that deal with many tasks at once by defining multiple threads.
11. High performance: Java is faster than other traditional interpreted programming
languages because Java bytecode is "close" to native code

Applications of Java:

1. Desktop based Applications:

All desktop applications can easily be developed in Java. Java also provides GUI
development capability through various means, mainly Abstract Windowing Toolkit
(AWT), Swings and JavaFX. Adobe creative cloud is one such which comes as a set
of applications and services from Adobe Inc. that gives subscribers access to a
collection of software used for graphic design, video editing, web development,
photography, along with a set of mobile applications and also some optional cloud
services.

2. Web based Applications:

Java is also used to develop web applications. It provides a vast support for web
applications through Servlets, JSPs, Spring and SpringBoot. Most popular
applications such as IRCTC, LinkedIn are developed in Java.

3. Mobile based Applications:

Java is considered as the official programming language for mobile app development.
Most popular apps such as spotify, netflix and twitter were developed using java.

4. Gaming Applications:

Java is widely used by game development companies because it has the support of the
open-source most powerful 3D engine. The most popular games developed in Java are
Minecraft, Mission Impossible III and Asphalt 6 etc.

5. Big Data Applications:

As many programming languages are available for Big Data Technology but still Java
is the first choice for the same. The tool Hadoop platform for processing and storing
big data applications is written in Java. In big data, Java is widely used in ETL
applications such as Apache Camel, Raptor and Apache Kafka. It is used to extract
and transform data, and load in big data environments.

6. Cloud based Applications:

A cloud application is the on-demand availability of IT resources via the internet. The
cloud-based application provides the service at a low cost. Java provides the
environment to develop cloud-based applications.Various Java cloud development
tools for cloud computing projects like Oracle Java Cloud Service, CloudFoundry,
Google App Engine, Openshift, IBM Smart Cloud, and AWS SDK for Java.

7. IOT based Applications:


IoT is a technology that connects the devices in its network and communicates with
them. IoT has found almost in all the small devices such as health gears, smartphones,
wearables, smart lighting, TVs, etc. For developing the IoT application there is a lot
of programming languages that can be used but Java offers an edge to developers that
is unparalleled.

Java Embedded Framework - provides access from java for hardware and one board
computers like Raspberry Pi, Orange Pi, Banana Pi and etc. to control SPI / I2C /
GPIO or Serial ports

8. AI based Applications:

Java is being used in many AI applications, from self-driving cars to robotic


assistants. It is also being used to power big data applications, such as facial
recognition systems. Java is also being used to create intelligent chatbots which can
interact with users naturally.

9. Scientific Applications:

Java has enhanced security features which makes it the best option for the
development of scientific applications. It has served as a powerful tool in coding
complex mathematical operations. The programs are designed in a highly secure and
efficient manner. Some of the most widely used applications like MATLAB use Java
as a component of the core system.

10. Software Tools:

There are many software tools written in Java. For example, Netbeans, IntelliJ IDEA,
and Eclipse are all IDEs written and developed in Java.

11. Murex is a financial services company that develops software for trading, treasury,
risk, and post-trade operations in the capital markets. Its software system, also
called Murex, is used by over 60,000 daily users in over 60 countries.

JDK Software:

JDK is an acronym for Java Development Kit. The Java Development Kit (JDK) is a software
development environment which is used to develop java applications

It contains JRE + development tools.

The JDK contains a private Java Virtual Machine (JVM) and a few other resources such as an
interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator
(Javadoc) etc. to complete the development of a Java Application.
The JRE contains a JVM and all the class libraries present in the production environment, as
well as additional libraries useful to developers.

Architecture of JVM:

Java Virtual Machine (JVM) is the heart of entire Java program execution process. First of
all, the .java program is converted into a .class file consisting of byte code instructions by the
java compiler at the time of compilation. Remember, this java compiler is outside the JVM.
This .class file is given to the JVM. Following figure shows the architecture of Java Virtual
Machine.

In JVM, there is a module (or program) called class loader sub system, which performs the
following instructions: ·

First of all, it loads the .class file into memory. ·

Then it verifies whether all byte code instructions are proper or not. If it finds any instruction
suspicious, the execution is rejected immediately

If the byte instructions are proper, then it allocates necessary memory to execute the program.
This memory is divided into 5 parts, called run time data areas, which contain the data and
results while running the program. These areas are as follows: 1. Method area: Method area is
the memory block, which stores the class code, code of the variables and code of the methods
in the Java program. (Method means functions written in a class).

2. Heap: This is the area where objects are created. Whenever JVM loads a class, method
and heap areas are immediately created in it.

3. Java Stacks: Method code is stored on Method area. But while running a method, it needs
some more memory to store the data and results. This memory is allotted on Java Stacks. So,
Java Stacks are memory area where Java methods are executed. While executing methods, a
separate frame will be created in the Java Stack, where the method is executed. JVM uses a
separate thread (or process) to execute each method.

4. PC (Program Counter) registers: These are the registers (memory areas), which contain
memory address of the instructions of the methods.

5. Native Method Stacks: Java methods are executed on Java Stacks. Similarly, native
methods (for example C/C++ functions) are executed on Native method stacks. To execute
the native methods, generally native method libraries (for example C/C++ header files) are
required. These header files are located and connected to JVM by a program, called Native
method interface.

Execution Engine contains interpreter and JIT compiler which translates the byte code
instructions into machine language which are executed by the microprocessor. Hot spot
(loops/iterations) is the area in .class file i.e. executed by JIT compiler. JVM will identify the
Hot spots in the .class files and it will give it to JIT compiler where the normal instructions
and statements of Java program are executed by the Java interpreter.

Basic Elements of Java:

Java program contains different types of elements like white spaces, comments and tokens. A
token is the smallest program element which is recognized by the compiler and which treats
them as defined for the compiler. A program is a set of tokens which comprise the following
elements:

Identifiers or names:

Identifier is the name of variables, methods, classes etc.

Rules for framing Names or Identifiers.

• It should be a single word which contains alphabets a to z or A to Z, digits 0 to 9,


underscore (_).

• It should not contain white spaces and special symbols.

• It should not be a keyword of Java.

• It should not be Boolean literal, that is, true or false.

• It should not be null literal.


• It should not start with a digit but it can start with an underscore.

• It can comprise one or more unicode characters which are characters as well as digits.

Conventions for Writing Names:

• Names of packages are completely in lower-case letters such as mypackage, java.lang.

• Names of classes and interfaces start with an upper-case letter.

• Names of methods start with a lower-case character.

• Names of variables should start with a lower-case character.

Keywords:

These are special words defined in Java and represent a set of instructions.

• The keywords represent groups of instructions for the compiler.

• These are special tokens that have a predefined meaning and their use is restricted.

• keywords cannot be used as names of variables, methods, classes, or packages.

• These are written in lower case.

• Keywords of Java Language are as follows:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy