Docsity

Introduction to Java Programming Language, Study notes of Java Programming

Toggle sidebar
bg1
What is Java?
Java is a programming language that folows the Object-Oriented programming paradigm (OOP).
โ†’
It was first released in 1995 by Sun Microsystems, and has since grown to be one of the most used programming languages.
โ†’
Java is a secure, and portable language.
โ†’
Why learn Java?
It's one of the most used programming languages in the world.
โ†’
The basic concepts are relatively easy to understand.
โ†’
โ†’
WORA, "write once, run anywhere"
โ†’
Java Virtual Machine
Information is received in binary numbers (0 and 1).
โ€ข
Some Electrivity
No Electricity
Using a sequence of 8 binary numbers, we can create text. For example, A is 01000001.
โ€ข
What does this have to do with Java?
Your Java code is compiled to binary numbers.
โ†’
The new intermediary code is fed to the Java Virtual Machine.
โ†’
The JVM then proceeds to identify your operating system and convert the intermediary code to native code
โ†’
Java Code compiler Intermediary Code JVM Native Code
Let's start coding your first program!
1 // HelloJava.java
2 public class HelloJava{
3 public static void main(String[] args){
4 System.out.println("Hello world!");
5 }
6}
Java Basics
Wednesday, 29 June 2022
8:14 am
Page 1 Page 1
pf3
pf4

Partial preview of the text

Download Introduction to Java Programming Language and more Study notes Java Programming in PDF only on Docsity!

What is Java?

โ†’ Java is a programming language that folows the Object-Oriented programming paradigm (OOP).

โ†’ It was first released in 1995 by Sun Microsystems, and has since grown to be one of the most used programming languages.

โ†’ Java is a secure, and portable language.

Why learn Java?

โ†’ It's one of the most used programming languages in the world.

โ†’ The basic concepts are relatively easy to understand.

โ†’ It's statically typed (the code can't be built before solving the errors.

โ†’ WORA, "write once, run anywhere"

Java Virtual Machine

  • Information is received in binary numbers (0 and 1). Some Electrivity No Electricity -^ Using a sequence of 8 binary numbers, we can create text. For example,^ A^ is^01000001.

What does this have to do with Java?

โ†’ Your Java code is compiled to binary numbers.

โ†’ The new intermediary code is fed to the Java Virtual Machine.

โ†’ The JVM then proceeds to identify your operating system and convert the intermediary code to native code

Java Code compiler Intermediary Code JVM Native Code

Let's start coding your first program!

1 // HelloJava.java

2 public class HelloJava{

3 public static void main(String[] args){

4 System.out.println("Hello world!");

Java Basics

Wednesday, 29 June 2022 8:14 am

Compiling and Running Java Code

๏‚ญ Before the JVM can do its part and run the code, a compiler is needed to get the bytecode understandable by JVM.

๏‚ญ The process is done by an Integrated Development Environment (IDE) automatically.

3 public static void main(String[] args){

4 System.out.println("Hello world!");

Output:

Hello world!

Whose output will be: You can also add Strings: Whose output will be: 1 String hello = "hi"; 2 System.out.println(hello); 3 System.out.println("hello"); Hi hello 1 String add = "This" + "string" + "is" + "concatenated"; This string is concatenated