Class 9 - Computer Applications - Introduction to Java
SeemantaBhowmick1
6 views
15 slides
Sep 14, 2025
Slide 1 of 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
About This Presentation
Java Basics
Size: 170.61 KB
Language: en
Added: Sep 14, 2025
Slides: 15 pages
Slide Content
CHAPTER 2 : INTRODUCTION TO JAVA
About JAVA Java is both a programming language and a platform. Like any other programming language, it can be used to write or create various types of computer applications. Java is also a platform for application development. The Java Platform is a software platform designed to deliver and run highly interactive, dynamic and secured applications on networked computer systems.
History of JAVA Java was originally named as Oak. Java is an object oriented programming language developed primarily by James Gosling and his colleagues. It was developed at Sun Micro Systems. Java, being an Object Oriented Programming Language has adopted many features of C++.
Compiler & Interpreter Compiler – A software that accepts the whole program written in high level language and converts into its equivalent machine level language. Interpreter – A software which converts the high level instructions line by line to machine level language.
Ordinary Compilation Process The process of converting a source code into machine code is called compilation . The converted machine code depends a lot on the platform it is executing upon. That means for different platforms , different machine code is produced. This resultant machine code is called the native executable code . The native executable code is directly executed on the corresponding computer for which it has been created. It is a 1–step process.
Ordinary Compilation Process
Java Compilation Process Compilation and execution of a Java program is a 2–step process. During the first compilation phase, Java compiler, compiles the source code ( .java ) and generates the byte code. This intermediate bytecode is saved in form of a .class file. In the second phase, the Java interpreter , Java Virtual Machine ( JVM ) takes the bytecode ( .class ) as input and generates the machine code ( .exe ) as output by executing the byte code.
Java Compilation Process
Summary of Java Compilation Process Java programs are written in “ .java ” file ( source code ) and then compiled by the Java compiler. Bytecode is the code generated after the Java program is compiled ( .class file ). Java Virtual Machine ( JVM ) is a virtual machine which reads the bytecode and interprets into the machine code depending upon the underlying operating system and hardware combination. Just In Time ( JIT ) compiler is part of the Java Virtual Machine ( JVM ) and it compiles the bytecode into executable code in real time, on a piece-by-piece demand basis.
Characteristics of Java Write Once Run Anywhere (WORA): The Java programs need to be written just once, which can be run on different platforms without making changes in the Java programs. Light Weight Code : With Java, no huge coding is required. Security: Java offers many enhanced security features. Object-Oriented Language: Java is object-oriented language, thereby, very near to real world. Platform Independent: Java is essentially platform independent. Change of platform does not affect the original Java program / application.
Types of Java Programs There are two types of Java programs : Internet Applets Standalone Applications
Internet Applets Sma ll programs that are embedded in web pages and are run on the viewer’s machine in a secured manner. It means limited access to system resources, that is hard disk by Java capable web browsers. Applets are designed to be delivered to Internet web browsers and that is why an applet has a built-in graphical window. But Java applets have some security restrictions, for example, it cannot write to a local file.
Standalone Applications It is generally a software application that does not require low level operating system or hardware access. This includes most of the usual desktop applications such as word processors or spreadsheets. Standalone Java applications could be distributed and installed on any java capable machine. Every standalone application of Java begins executing with a main method.
BlueJ BlueJ is a Java development environment. It is an IDE (Integrated Development Environment) which includes an editor, a debugger and a viewer. It offers an easy way to run Java programs and view the documentation.