0% found this document useful (0 votes)
43 views4 pages

Day 5

1. Java is an object-oriented programming language that is platform independent. 2. Java was invented by James Gosling at Sun Microsystems in 1991 to achieve platform independence for developing internet applications. 3. In Java, programs are compiled to bytecode that can be executed on any Java Virtual Machine, allowing the same program to run on different platforms like Windows, Linux, and MacOS.

Uploaded by

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

Day 5

1. Java is an object-oriented programming language that is platform independent. 2. Java was invented by James Gosling at Sun Microsystems in 1991 to achieve platform independence for developing internet applications. 3. In Java, programs are compiled to bytecode that can be executed on any Java Virtual Machine, allowing the same program to run on different platforms like Windows, Linux, and MacOS.

Uploaded by

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

Chapter #1: Introduction to Java

1. What is Java?
2. Who invented Java?
3. Why Java?
4. Platform, Platform Dependency(PD), Platform Independency(PI)?
5. Two types of applications?
6. Java concepts to develop Stand-alone(SA) and Internet Application(IA)?

7. Why C and C++ PLs are PD?


8. How Java achieved PI?
9. Import facts on Java program and Java software?
10. Types of Java SWs, Java 9v and 11v changes?

11. Java versions, LTS, non-LTS, Stable and Latest version?


12. Downloading and installing JDK
13. Setting JAVA_HOME, path and classpath enviroment varaibles

14. Softwares required to develop a Java program?


15. Essential Statements to develop a Java program?
14. Steps to develop Java program?
15. Hello, World! application development, compilation and execution
16. Solving CEs and REs by your own
17. Compiler and JVM activites in compiling and executing Java program

1. What is Java?
- Java is a Platform Independent
Object-Oriented Programming Language.

2. Who invented Java?


- Java is inveted by Mr. James Gosling
in Sun Microsystems in the year 1991

3. Why Java is invented?


- Java is invented for achieving Platform Independency
for supporting internet applications development.

4. What is a platform?
- A platform is an environment in which
a program is loaded and executed.

- A platform can be a software only platform


or hardware only platform of both.

- A computer platform is both SW and HW platform


it is [OS + Hardware Devices]

- C and C++ programs' platform is


software only platform that is OS

- Java programs platform is JVM (Java Virtual Machine)


- Python programs platform is PVM (Python Virtual Machine)
- HTML pages platfrom is Browser
- mp3 and mp4 files platform is VLC (Media Player Software)

5. What is platfrom dependency?


- A program that is developed and compiled in OS
if it is not executed in different OS, we call it
as platform dependent program. The programming language
that is used for developing this program is called
platform dependent programming language.

For example: C and C++

6. What is platfrom independency?


- A program that is developed and compiled in OS
if it is executed in different OS, we call it
as platform independent program. The programming language
that is used for developing this program is called
platform independent programming language.

For example: Java, Python, .Net, ...

7. Types of applications
- All softwares are divided into two types
1. Stand-alone applications (SA)
2. Internet applications (IA)

- An application that can not be accessed from other computers


via internet with network call stand-alone application. It means
an application that can be accessed only within one computer with
local call in which it is installed is called stand-alone application.

- A SA is a single computer and single user application. It means


at a time only one user can use/run this application.

For example: Calc, Notepad, Paint, PPT, Browser, Mobile app

- An application that can accessed via internet with a network call


is called internet application. An internet application can also
be accessed with in the same computer in which it is installed.

- An IA is a multi computer and multi user application. It means


at time it can be accessed and executed by multiple users.

For example: hdfcbank.com, flipkart.com, irctc.com, nareshit.com, ...

8. Java concepts to develop SA and IA?


- For developing SA just Core Java concepts are sufficient.
- For developing IA along with Core Java concepts, we must also
use Adv Java or Spring Boot concepts.

- By using Core Java concepts we can develop one complete project.


But this project cann't be accessed from other computer through network.
- Core Java develops project, ADV Java and Spring Boot, makes this project
internet accessible and DB accessible.

9. Why C and C++ programs are PD?


- The C and C++ programs are compiled targetting to one OS.
- Hence the C and C++ programs compiled code contains direct
machine language of current OS whose format is not understandable
to other OS, hence it cann't be executed by other OS, hence
C and C++ programs are PD.

Windows OS
Source code Compiled code
Addition.c Compiler Addition.exe windows -> exe -> OP
(M/C=0s and 1s)

Linux OS
Addition.exe Linux -> !exe

Mac OS
Addition.exe Mac -> !exe

10. How Java achieved PI?

Windows OS
Addition.java

Java
Compiler

Addition.class
(Byte code=Small commands)

Windows OS Linux Os Mac OS

Addition.class Addition.class Addition.class

Windows Linux Mac


JVM JVM JVM

Converts Converts Converts


B/C to M/C B/C to M/C B/C to M/C
of Windows of Linux of Mac

Windows OS Linux OS Mac OS


Exe MC Exe MC Exe MC

generates generates generates


O/P O/P O/P

- In Java, program is not compiled targetting to any particular OS.


- In Java, program is compiled into an intermediate code called bytecode
which common to all OSs.
- To convet this byte code into a particaly OS MC, we have a translation SW
called JVM.

- For achieving PI, in Java the MC generation is moved


from compilation phase to execution phase by introducing
1. new compiler software
2. byte code
3. JVM

- This new compiler software convets source code into bytecode


- The byte code the set of instruction to the JVM to run Java program.
Byte code is not MC or not native code to an OS or processor, it
is the native code of JVM.
- JVM is the Java platform, it is responsible for running Java byte code
by converting it into current OS MC.

- We have sepearte JVM for each OS for the running the same compiled
in all OS, hence Java program is PI.

Summary
- If any PL program contains MC and if it is executed directly by OS,
it is always PD.

- If any PL program does not contain MC, not directly executed by OS,
if it is executed by one intermediate software, that program is always
PI.

You might also like