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

Basic 1

Java is a platform independent, object-oriented programming language. It uses a compiler to convert Java code into bytecode, which can then be run on any Java Virtual Machine (JVM) regardless of computer hardware or operating system. The key components of the Java platform are the JDK for development, the JRE for execution, and the JVM which interprets the bytecode and performs just-in-time compilation to native machine code. Java's platform independence and portability are made possible through its two-step compilation process and use of a virtual machine.

Uploaded by

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

Basic 1

Java is a platform independent, object-oriented programming language. It uses a compiler to convert Java code into bytecode, which can then be run on any Java Virtual Machine (JVM) regardless of computer hardware or operating system. The key components of the Java platform are the JDK for development, the JRE for execution, and the JVM which interprets the bytecode and performs just-in-time compilation to native machine code. Java's platform independence and portability are made possible through its two-step compilation process and use of a virtual machine.

Uploaded by

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

Java Features

Programming Language

The language which is used to communicate with a computer to


perform a specific task is known as programming language.

instructions
User Language Task
Types of Programming Language

There are Three Types or levels of Programming Languages

1. Low Level Language(Machine Level Language).


2. Assembler Level Language(Mid Level Language).
3. High Level Language.
Low Level Language

• Low level language also known as Machine level programming Language.

• A language which is understandable ,readable, executable by a machine is


known as machine understandable language.

• Machine understands only binary language i.e. 0’s and 1’s.

• Machine level language is quite easy for a machine to understand but not
for humans.

• 0 is represent as-Low.

• 1 is represent as -High.
Assembly Level Language
• The language which is understandable by microprocessor is known as assembly level language.

• Assembly language is an example of middle-level language.

• In Assembly level language we have some predefined words known as Mnemonics.

• Example: ADD,SUB,MUL etc.

Disadvantage:
1) Decision Making.
2) Looping Statement.
High Level Language

• High Level language is easy to read, write and understand the


instructions.
• The high level language is understandable by the machine with
the help of software called as complier or Interpreter.
• Example:
C,Java,Python.
Compiler

• A compiler is a computer program that transforms code written in


a high-level programming language into the machine code.
• It is a program which translates the human-readable code to a
language a computer processor understands (binary 1 and 0 bits).
Interpreter

• It is designed in such a way that it can read the source program


and translate the source code instruction by instruction.
• It converts the high-level program into machine language.
Interpreter Vs Compiler
JDK

Abbreviated as Java Development Kit is a package which consists of java development tools like java
complier and JRE for execution.
➔ It have a development tools like javac, javadoc, java as well as JRE.
➔ Essential for a programmer to compile and execute java application .
JRE

Abbreviated as Java Runtime Environment. It is a Environment which consists of JVM and built
In classes which is required for the execution of java program.
● It have some components such has JVM, Class loader, Interpreter, just in time
compiler and as well as built in packagers.
JVM
• Abbreviated as Java Virtual Machine.
• It converts byte code instruction line by line into current System machine level language with help of an interpreter.
• It is called as virtual machine because it doesn't physically exist.
• JVM which drives all other components of JRE.
• It have some components such as
Class loader:
It loads the class file from secondary memory into primary (JRE).
Interpreter:
It is used to convert byte code instruction into native machine understandable language
Just in Time compiler:(JIT)
It is used to increase the runtime efficiency.
Platform dependent

• A software developed on one platform and executed on the same platform is


known as platform dependent.
• Example: C, C++.
Platform dependent example

Note:
● A Software built using c and c++ are platform dependent.

Win os 32 bit
c.sourcefile Class file

c Mac
FB compiler os

developer Win os 32bit Fb.c linux


os

● C is one step compilation.


● Because when we give Source file as an i/p to c compiler ,the compiler directly
convert Source file to executable file.
Platform independent

• A software developed on one platform and executed on any


platform is known as platform independent.

Win os

insta
FB Mac os

Window os Linux os
Developer 64 bit
Platform independent example
❖ Note:
❖ A Software using built in java platform independent.

Executable by
Java source byte code JRE Win
file os
Javacompile
JRE
r
Mac os
JRE
Linux
insta.class os
Developer insta
Winos insta.java
64bit

● Java is a two step compilation.


Why java is Platform independent ?

• Java compiler does not directly convert high level language into a machine understandable language,
instead it converts java instructions into intermediate language called as ByteCode.
• The file is known as the class file with extension .class.
• Once the class file is ready it can be executed in any machine which has JVM in it. This makes the java a
platform independent.
Processor
JAVAC Byte Code
JVM
Executeable class file
compiler

JRE
Source Code
JDK O/P
Source File, Class File, Byte code

Source File:
❖ Source file is generated by programmer or Developer.
❖ Every source file should have a name and also it should have an extension.java.
❖ It consists an instruction written in java language.
Class File:
❖ Class file is generated by java compiler.
❖ Every class file have an extension.class.
❖ Every class file will consist an intermediate language called byte code.
Byte code:
❖ Byte code is an intermediate language which is neither understandable by the programmer
nor by a machine.
❖ It is understand only in JRE.
Note

• Java is platform independent language but, it is JVM


dependent language.
• We cannot execute the class file or byte code in which the
system does not contain JVM.
Command line prompt

• It is command line user interface


• File Structure: In windows hard disk can be divided into multiple portions
and each portion is known as drive.
• Each drive has a name. Ex : C:, D:, E:
• User home Directory: The folder that is created in user name inside the
users folder is known as user home directory.
• Whenever we open the command prompt by default we are inside the
user home directory.
• Working Directory: The folder which is currently in use is known as
working directory or Current Working directory.
Path
A path is used to travel from one directory into another directory.

• Types of path
1. Absolute path : The path which starts from drive name is known as
Absolute path.
It is not dependent on working directory
Example: C//users//abc.txt
2. Relative path: The path which starts from directory/folder name is known
as relative path.
It is always dependent on the working directory.
Example: Users//abc.txt
Basic Commands
1. cd– Change Directory: used to change Directory.
2. md or mkdir– Used to create directory/folder.
Syntax: mkdir folder1 folder2
Or
md folder1 folder2
3. dir– used to list of all the files and directories present in the working directory.
4. cls—clears the screen.
5. javac– Used to compile a java source file. We should pass source name as input
to this as mentioned below:
javac filname.java
6. java—Used to execute java class file. We should pass class filename as an input
to this as mentioned below:
java filename
7. ../../../-- Used to move backward multiple folder.

You might also like