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

Java Introduction

The document provides an overview of the C and Java programming languages, highlighting their differences, such as C being platform-dependent and compiled, while Java is platform-independent and interpreted. It discusses Java's features, including its simplicity, security, portability, and object-oriented nature, as well as the various editions of Java available for different applications. Additionally, it outlines the installation process and environment variable settings necessary for Java development on a Windows system.

Uploaded by

bhavikjangade
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)
2 views4 pages

Java Introduction

The document provides an overview of the C and Java programming languages, highlighting their differences, such as C being platform-dependent and compiled, while Java is platform-independent and interpreted. It discusses Java's features, including its simplicity, security, portability, and object-oriented nature, as well as the various editions of Java available for different applications. Additionally, it outlines the installation process and environment variable settings necessary for Java development on a Windows system.

Uploaded by

bhavikjangade
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

C-> Test.c [Source] --> Test.exe [ Machine Lang.

]
Data type of C: int 2 byte windows, Linux 4 byte

C is platform dependent - Platform = H.W +O.S


C is a compilear language.

https://www.geeksforgeeks.org/difference-between-compiler-and-interpreter/

Java -> Test.java --> Test.class


[byte code] platform independent
|
J.V.M (Java Virtual Machine) int a=10;
-> [byte code 0] -> [interpreted] ->Execute
| Interpreter
[ byte code 1]
O/S
[byte code 1000]

Java is a Interpreted Language.

1990 -> started working on lang.


1991 -> OAK --> 1995 Java [Sun Microsystem -> 2009 -> Oracle
Corporation]
1

Why Java Is Important to the Internet


-----------------------------------------

The Java Buzzwords


------------------

* Simple :- knowledge of c
* Secure :- Virus & important data
* Portable :- bytecode which is executed with the help of jvm
* Object-oriented: Java is a Pure OOPs
* Robust :- Strong
- checks for errors at compile time. // c lang int
pi=3.14;
- memory management mistakes and

- mishandled exceptional conditions (that is, run-time


errors).
try,catch, throw, throws, finally

https://www.digitalocean.com/community/tutorials/java-heap-space-vs-stack-memory

* Multithreaded : programs that do many things simultaneously.


* Architecture-neutral:- platform-independent Data Type: int size 4byte,
* Interpreted : Java was engineered for interpretation of the Java bytecode to
machine code for very high performance by using a just-in-time compiler.
* High performance :- Just In Time Compiler (JIT)
* Distributed : Java is designed for the distributed environment of the Internet,
because it handles TCP/IP protocols.
* Dynamic :- Servlets/ JSP
download java standard edition 8
------------------------------------
vbkalamkhede@gmail.com

pw: Gone@1992#

Java Downloads | Oracle

Java comes in 3 different Editions


-------------------------------------
1) Standard Edition - Core + Advance Java (networking,jdbc,swing)
j2sdk 1.0, 1.1 .. 1.4, java sdk5,
Java 1.8 April-2014, ..... Java 17
Java SE Development Kit 19.0.2 downloads (2023)

2) Enterprize Edition -> j2ee servlets, jsp, Hybernates


(Tech. to develop Web pages)

3) Micro Edition -> develop software for electronics devices such as cell
phone, palm computers, etc.

Installation of Software: Standard Edition.


--------------------------
While installation observer carefully the installation folder for your sofware and
note down.

For 64 bit o.s path=d

JAVA_HOME -->> C:\Program Files\Java\jdk1.8.0_202


PATH ->> C:\Program Files\Java\jdk1.8.0_202\bin
CLASSPATH ->> C:\Program Files\Java\jdk1.8.0_202\jre\lib\rt.jar

<java home>
|
|-<bin>-- [ javac.exe, java.exe,
appletviewer.exe, ]
|-<jre><lib>-- rt.jar , ...
|-<include>
|-<lib>

command prompt: Run / Search cmd

'javac' is not recognized as an internal or external command,


operable program or batch file.

Setting of Environment Variables: PATH, CLASSPATH, JAVA_HOME


--------------------------------

PATH -> Edit value = C:\Program Files\Java\jdk1.8.0_202\bin


JAVA_HOME -> New value = C:\Program Files\Java\jdk1.8.0_202
CLASSPATH -> New value = .;C:\Program Files\Java\jdk1.8.0_202\jre\lib\rt.jar

Select [This PC] -> Properties : This opens System Information:


go to Find a settting:
* Edit the system environment variable. <- Select
* Edit the environment variable for your account
This will open System Envirnoment Window
Click Environment Variables button.
This will Open two panels.
Go to System Variable panel and locate path. Select path

1) User Variable :- New Button : path,classpath, java_home

2) System Variable :- Edit Button : path


New Button : classpath, java_home

path - ......;C:\Program Files\Java\jdk1.8.0_111\bin


classpath - .;C:\Program Files\Java\jdk1.8.0_121\jre\lib\rt.jar

java_home - C:\Program Files\Java\jdk1.8.0_111


jre_home - C:\Program Files (x86)\Java\jre1.8.0_111
-----------------------------------------------------------------------------

* CHECKING/ SETTING Temporarily Env. Variables.


------------------------------------------------------
Open Command Window
- path [ = new_path ] <- setting temporary path=
%path%;d:\abc
- set classpath [= new_classpath] <- setting temporary
- SET JAVA_HOME [= new java_home]
- echo %path% WINDOWS
- echo $PATH LINUX
- echo %CLASSPATH%
- echo %JAVA_HOME%
path = d:
javac

Testing: javac
- information about javac tool
- error :C:\>javac
'javac' is not recognized as an internal or external
command,
operable program or batch file.

Tips for Writing Java applications:


------------------------------------
- Keyword: lower case alphabet e.g: public, static, void
- Class Name: Proper -> Test, String, System, StudentResult
- Variable & Method : camel-case e.g print(), println(), Integer.parseInt()
variable - employeeSalary, salary,
empMarchSalary

A First Simple Program


--------------------------
class Test{
public static void main(String args[]) {
System.out.println("This is in Java");
System.out.print("Good");
System.out.print(" bye!");
}
}

Save as : "Test.java" or
Test.java select save as type : all files
Compile: javac Test.java
Run: java Test

The name you give to a source file is very important. For this example, the name
of the source file should be Test.java.

public : means you want to access main() from outside the class Test
(i.e. from command prompt)
static : without creating object of class Test.
void : no return statment

run: java Test


|
Runtime: locates Test.class if found then load that class into memory
|
memory
- static members are created first (variable, methods)
public static void main(String args[]){ .. }
- j.v.m create one thread [main].
- Next program execution begins from
main() which is in memory.

O/P: This is in Java


Good bye!

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