Day 1 Tech
Day 1 Tech
Introduction to JAVA
Java is a programming language and a platform. Java is a high level,
robust, object-oriented and secure programming language.
company, so James Gosling and his team changed the name from Oak to
Java.
void is the return type of the method. It means it doesn't return any value.
String[] args is used for command line argument. We will learn it later.
JVMs are available for many hardware and software platforms. JVM, JRE, and
JDK are platform dependent because the configuration of each OS is different
from each other. However, Java is platform independent. There are three notions
of the JVM: specification, implementation, and instance.
According to Sun, 3 billion devices run Java. There are many devices
where Java is currently used. Some of them are as follows:
• Web Application
• Enterprise Application
• Mobile Application
Types of Java Editions
• Java SE – Standard Edition
• JavaFX
Why is JAVA Platform
Independent?
Why is JAVA both
interpreted and
compiled language?
Why is JAVA slow?
Dynamic Linking
Run-time Interpreter
Data Types in Java
Data types specify the different sizes and values
that can be stored in the variable.
void method() {
int n = 90; // local variable
System.out.println(n);
}
public static void main(String
args[]) {
Variable v = new Variable();
v.method();
int data = 50; // local variable
System.out.println(v.m);
System.out.println(data);
}
}
Operators in Java
Operator Type Category Precedence
additive +-
equality == !=
bitwise exclusive OR ^
bitwise inclusive OR |
logical OR ||
Ternary ternary ?: