We humans use a decimal, or base-10, numbering system, presumably because people have 10 fingers
Ā
Early computers were designed around the decimal numbering system. This approach made the creation of computer logic capabilities unnecessarily complex and did not make efficient use of resources. (For example, 10 vacuum tubes were needed to represent one decimal digit.)
Ā
Story behind
Ā To deal with the basic electronic states of on and off, Von Neumann suggested using the binary numbering system
What happens behind the scenes?
Why Java is Platform independent.
.java file
(source code)
.classĀ file
(byte code)
Machine Code (0s & 1s)
compiler
interpreter
What happens behind the scenes?
Why Java is Platform independent.
.java file
(source code)
.classĀ file
(byte code)
Machine Code (0s & 1s)
compiler
interpreter
Byte Code doesn't run directly, we need a JVM (Java Virtual Machine) to run this code
C/C++ Compiler generates a .exe file which is platform dependent.
In Java we get bytecode, JVM converts this bytecode into machine code.
To run byte-code, we need a JVM installed on a machine.
Java is platform independent but JVM is platform dependent.
Python is interpreted language, instructions are executed line by line.
IntelliJ Idea (IDE)
https://www.jetbrains.com/idea/downloadĀ
(Free Community Edition)
JDK
https://www.oracle.com/java/technologies/downloads/#java16
Ā
Ā
Ā
Architecture
JDK = JRE + Development Tools
JRE = JVM + Library Classes
JDK = JRE + Development Tools
Java Virtual Machine (JVM)
JIT Compiler
(Just In Time)
Consists of Development tools & environment to run the Java program.
1. Development Tools
2. Compiler (javac)
3. Archiver (jar)
4. docs generator (javadoc)
5. interpreter / loader
Provides environment to only run the program.
JRE = JVM + Additional technologies & features
Ā
1. Deployment solutions
2. Development toolkits & libraries
3. Integration libraries
4. Language and utility libraries
Ā Ā Ā (such as collections framework)
Java Virtual Machine
Java Virtual Machine, or JVM, loads, verifies and executes Java bytecode. It is known as the interpreter or the core of Java programming language because it executes Java code.
The JRE combines Java code created using the JDK with the necessary libraries required to run it on a JVM and then creates an instance of the JVM that executes the resulting program.
Ā
JVMs are available for multiple operating systems, and programs created with the JRE will run on all of them. In this way, the Java Runtime Environment is what enables a Java program to run in any operating system without modification.
ide.codingminutes.com
No Installation Required!
Directly Run | Save | Share Codes!
Boilerplate Code
//Boilerplate Code
class Main
{
public static void main (String[] args)
{
}
}
Boilerplate Code
//Boilerplate Code
class Main
{
public static void main (String[] args)
{
//Your Code goes here
}
}
Boilerplate Code
//Boilerplate Code
class Main
{
public static void main (String[] args)
{
//Your Code goes here
System.out.println("Hello World");
}
}
Bookmark this Link
Let's Solve Problems & learn Java syntax!
Ā
Ā
Ā
1. Hello Java
2. VariablesĀ
3. Loops
4. Typecasting
5. Problems - Prime Numbers, Patterns, Simple Interest
Ā
variable = (condition) ? expressionTrue :Ā expressionFalse;
Ternary Operator