Core Java Basics: Presenters: Dinesh Kumar Rajat Srivastava
Core Java Basics: Presenters: Dinesh Kumar Rajat Srivastava
Presenters:
Dinesh Kumar
Rajat Srivastava
Agenda
Java Introduction
History and versions
Platform independence
OOPS
Q&A
Java Introduction
Platform Independent
OOPS support
Secure
Supports Multi-threading
• Feb 1997
JDK 1.1 • Inner classes, JavaBeans, JDBC, RMI, Reflection etc.
• March 2014
JAVA SE 8 • Lambda Expression, Stream API, Date Time API, Base 64, Security, Functional Interface etc.
Version History contd…
• Sep 2017
JAVA SE 9 • Java Modules, JShell (REPL), Http 2clientetc.
• March 2018
JAVA SE 10 • GC interface, Application Data-Class sharing, Local variable type interface etc.
• Sep 2018
JAVA SE 11 • New String methods, Files read/write string, single-file source etc.
Compiler
.class Byte Code
Java Editions
Single Inheritance
Vehicle
FourWheeler
FourWheeler
BMW
Types of Inheritance Cont…
TwoWheeler FourWheeler
Vehicle
TwoWheeler FourWheeler
BMW
“HAS-A” relationship
Vehicle
TwoWheeler FourWheeler
• Denotes a situation where Object(s) of Class MusicSystem ‘belong to’ Class BMW
• Implies reference from BMW to MusicSystem
• Also implies that object of Class MusicSystem retain an existence independent of
Class BMW.
“HAS-A” relationship
Vehicle
TwoWheeler FourWheeler
BMW Carburetor
Composition
Java Literals
• Literals are represented directly in the code without any computation.
• Literals can be assigned to any primitive type variable.
• Example: int a = 10;
Operators
Called Logical NOT Modulus AND assignment operator. It takes modulus using
%=
Operator. Use to two operands and assign the result to left operand.
reverses the logical state <<= Left shift AND assignment operator.
! (logical not) of its operand. If a >>= Bitwise AND assignment operator.
condition is true then &= Right shift AND assignment operator.
Logical NOT operator
^= bitwise exclusive OR and assignment operator.
will make false.
|= bitwise inclusive OR and assignment operator.
Operators Cont…