SlideShare a Scribd company logo
Java Basics
by Yuriy Voznyak, Software Engineer
eleks.com
Lecture Goal or Why Java?
● Become familiar with one more great
platform;
● Introduction to Android development;
● Understand the difference between
Java and another popular languages
such as C# or C++
● 30 Billion Devices
● ...
Why did Java invent?
1. Write Once, Run Everywhere. This old Sun slogan describes very ambitious
goal. Sun wanted to create cross-platform language;
2. Java Virtual Machine should run every application in the separate sandbox
with dedicated permission; So, applications and environment should provide
better security than with using of unmanaged code
3. Easy distribution over Internet as Java applications or Java Applets;
4. Built-in Multithreading support;
5. To replace C/C++ with a better design;
What do I need for Java?
● If I want to run Java applications on Desktop, there is a JRE (Java Runtime
Environment);
● For servers there is another JRE - Server JRE (Server Java Runtime
Environment). Contains tools for JVM monitoring and some tools required for
server applications, but does not include browser integration (the Java plug-in),
auto-update, nor an installer;
● I want to develop Java Software: need Oracle JDK (Java Development Kit).
Includes a complete JRE plus tools for developing, debugging, and monitoring
Java applications;
● I want to learn Java deeper or have some extra needs: there is open-source Java
implementation called OpenJDK.
Java Editions
Java Standard
Edition (Java SE)
lets you develop and
deploy Java applications
on desktops and servers,
as well as embedded
environments. Most
common used.
Java Enterprise
Edition (Java EE)
Extended overset of java
engine, contains
specifications for designing
and developing of Big
Enterprise Network
Applications
Java Micro Edition
(Java ME)
a subset of Java, designed
for devices with limited
hardware characteristics.
Java Embedded
Edition
Oracle`s marketing term.
Contain some binaries to
work with Raspberry Pi
or ARM devboards
Java DB
Just a implementation of
open-source database
engine
Java Card
Technology to develop
Smart Cards secure
applets. Sooo limited
and low-level
Marketing sets Specialized
Technologies Structure
Noticeable Java Feature Differences
● Syntax is a bit simpler. Really
● Packages instead of namespaces
● No default values
● Values are passed by value only. But, for reference types, value is reference.
So, you just pass copy of the reverence: is able to modify but unable to assign
another reference;
● Methods names begin from capital letter :)
● Observer patterns everywhere with anonymous classes
● Java runs not only on Windows
● Less syntax sugar
Main Method
C#
static void Main(string[] args)
… or even
static void Main()
Java
public static void main(String[] args)
Standard Output
C#
System.Console.WriteLine("Important Message");
Java
System.out.println("Important Message");
Declaring Constants
C#
const int Constant = 42;
Java
[public] static final int CONSTANT = 42;
Inheritance
C#
class Child : Parent, IDerivable
{
...
}
Java
class Child extends Parent implements Derivable {
...
}
Exceptions
1-dimensional Collections
Primitive Types
type size range default value wrapper
byte 1 From +127 to -128 0 Byte
short 2 From +32,767 to -32,768 0 Short
int 4 From +2,147,483,647 to -2,147,483,648 0 Integer
long 8 From +9,223,372,036,854,775,807 to -
9,223,372,036,854,775,808
0L Long
float 4 From 3.402,823,5 E+38 to 1.4 E-45 0.0f Float
double 8 From 1.797,693,134,862,315,7 E+308 to 4.9 E-324 0.0d Double
char 2 All Unicode characters 'u0000' Character
boolean 1 False, true false Boolean
Moar Difference
● In Java methods are virtual by default but you can make them final. (In C# they are
sealed by default, but you can make them virtual.)
● Generics are completely different between the two; Java generics are just a
compile-time "trick" (but a useful one at that). In C# and .NET generics are
maintained at execution time too, and work for value types as well as reference
types.
● Java doesn't allow the creation of user-defined value types
● Java doesn't support overloading
● Java doesn't have anything like LINQ
● Partly due to not having delegates, Java doesn't have anything quite like
anonymous methods and lambda expressions (in Java 8 does). Anonymous inner
classes usually fill these roles.
● Java doesn't have implicitly typed local variables (var directive)
Please, stop!
● Java doesn't have extension methods
● The access modifiers are somewhat different - in Java there's (currently) no direct
equivalent of an assembly, so no idea of "internal" visibility;
● Java doesn't have the equivalent of "unsafe" code
● Java has no preprocessor directives (#define, #if etc)
● Java has no equivalent of C#'s ref and out for passing parameters by reference
● Java has no equivalent of partial types
● Java has no unsigned integer types
● Java has no language support for a decimal type. However, java.math.BigDecimal
provides similar functionality
● Java has no equivalent of nullable value types
● Java doesn't have static classes (which don't have any instance constructors, and
can't be used for variables, parameters etc)
Is it all?
Of course, no.
However…
● in C# there's no equivalent to the "default" visibility in Java which takes account of
namespace
● C# interfaces cannot declare fields. In java interfaces can contain static final fields
and even implementation (sic!)
● C# doesn't have checked exceptions
● C# doesn't have anonymous inner classes
● C# doesn't have Java's inner classes at all, in fact - all nested classes in C# are like
Java's static nested classes
How to write Java application?
1.
2.
What is Jar
JAR file is a file format based on the popular ZIP file format
and is used for aggregating many files into one. A JAR file
is essentially a zip file that contains an optional META-INF
directory. A JAR file can be created by the command-line
jar tool, or by using the java.util.jar API in the Java
platform. There is no restriction on the name of a JAR file,
it can be any legal file name on a particular platform.
In many cases, JAR files are not just simple archives of
java classes files and/or resources. They are used as
building blocks for applications and extensions. The
META-INF directory, if it exists, is used to store package
and extension configuration data, including security,
versioning, extension and services.
Designing Classes Structure
explicit-representation principle: classes included to reflect natural categories;
no-duplication principle: member functions situated among class definitions to facilitate
sharing;
local-view principle: program elements placed to make it easy to see how the elements
interact;
look-it-up principle: class definitions including member variables for stable, frequently
requested information;
need-to-know principle, with public interfaces designed to restrict member-variable and
member-function access, thus facilitating the improvement and maintenance of
nonpublic program elements;
keep-it-simple principle: class and function definitions are broken up when these
definitions become too complex to understand;
modularity principle, with program elements divided into logically coherent modules.
Where to Read More
1. Documentation
2. Books
3. Internet
4. Source Code
Let`s try!
Inspired by Technology.
Driven by Value.
Find us at eleks.com Have a question? Write to eleksinfo@eleks.com
Ad

More Related Content

What's hot (20)

Introduction to java
Introduction to javaIntroduction to java
Introduction to java
Veerabadra Badra
 
JavaFX in Action Part I
JavaFX in Action Part IJavaFX in Action Part I
JavaFX in Action Part I
Mohammad Hossein Rimaz
 
Using Zend Framework 2 Book Presentation
Using Zend Framework 2 Book PresentationUsing Zend Framework 2 Book Presentation
Using Zend Framework 2 Book Presentation
olegkrivtsov
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
Sujit Majety
 
J2EE Struts with Hibernate Framework
J2EE Struts with Hibernate FrameworkJ2EE Struts with Hibernate Framework
J2EE Struts with Hibernate Framework
mparth
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
ph7 -
 
Java Programming
Java ProgrammingJava Programming
Java Programming
Elizabeth alexander
 
Spring presentation
Spring presentationSpring presentation
Spring presentation
Chandan Sharma
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance Java
Vikas Goyal
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
Professional Guru
 
Spring ppt
Spring pptSpring ppt
Spring ppt
Mumbai Academisc
 
Groovy features
Groovy featuresGroovy features
Groovy features
Ramakrishna kapa
 
Springboot introduction
Springboot introductionSpringboot introduction
Springboot introduction
Sagar Verma
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
javeed_mhd
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of java
CIB Egypt
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Java Lover
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
Saba Ameer
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
pm2214
 
Tellurium At Rich Web Experience2009
Tellurium At Rich Web Experience2009Tellurium At Rich Web Experience2009
Tellurium At Rich Web Experience2009
John.Jian.Fang
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
Professional Guru
 
Using Zend Framework 2 Book Presentation
Using Zend Framework 2 Book PresentationUsing Zend Framework 2 Book Presentation
Using Zend Framework 2 Book Presentation
olegkrivtsov
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
Sujit Majety
 
J2EE Struts with Hibernate Framework
J2EE Struts with Hibernate FrameworkJ2EE Struts with Hibernate Framework
J2EE Struts with Hibernate Framework
mparth
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
ph7 -
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance Java
Vikas Goyal
 
Springboot introduction
Springboot introductionSpringboot introduction
Springboot introduction
Sagar Verma
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
javeed_mhd
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of java
CIB Egypt
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Java Lover
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
Saba Ameer
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
pm2214
 
Tellurium At Rich Web Experience2009
Tellurium At Rich Web Experience2009Tellurium At Rich Web Experience2009
Tellurium At Rich Web Experience2009
John.Jian.Fang
 

Similar to Lecture java basics (20)

Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
DevaKumari Vijay
 
Java chapter 1
Java   chapter 1Java   chapter 1
Java chapter 1
Mukesh Tekwani
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
princeirfancivil
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
sanjay joshi
 
Chapter One Basics ofJava Programmming.pptx
Chapter One Basics ofJava Programmming.pptxChapter One Basics ofJava Programmming.pptx
Chapter One Basics ofJava Programmming.pptx
Prashant416351
 
Getting Started with JAVA
Getting Started with JAVAGetting Started with JAVA
Getting Started with JAVA
ShivamPathak318367
 
What is java
What is javaWhat is java
What is java
javaicon
 
Java Technologies notes of unit 1 and 2.
Java Technologies notes of unit 1 and 2.Java Technologies notes of unit 1 and 2.
Java Technologies notes of unit 1 and 2.
sumanyadavdpg
 
Java Fundamentals in Mule
Java Fundamentals in MuleJava Fundamentals in Mule
Java Fundamentals in Mule
Anand kalla
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
TIB Academy
 
java introduction.docx
java introduction.docxjava introduction.docx
java introduction.docx
vikasbagra9887
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
sanjay joshi
 
OOPS JAVA.pdf
OOPS JAVA.pdfOOPS JAVA.pdf
OOPS JAVA.pdf
DeepanshuMidha5140
 
2 22CA026_Advance Java Programming_Data types and Operators.pptx
2 22CA026_Advance Java Programming_Data types and Operators.pptx2 22CA026_Advance Java Programming_Data types and Operators.pptx
2 22CA026_Advance Java Programming_Data types and Operators.pptx
dolphiverma80
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Phaniu
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
javeed_mhd
 
Java Basics
Java BasicsJava Basics
Java Basics
Khan625
 
Java Basics in Mule
Java Basics in MuleJava Basics in Mule
Java Basics in Mule
Rajkattamuri
 
Java in Mule
Java in MuleJava in Mule
Java in Mule
Shahid Shaik
 
Java. converted (2)
Java. converted (2)Java. converted (2)
Java. converted (2)
AVINASHMEHRA6
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
DevaKumari Vijay
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
sanjay joshi
 
Chapter One Basics ofJava Programmming.pptx
Chapter One Basics ofJava Programmming.pptxChapter One Basics ofJava Programmming.pptx
Chapter One Basics ofJava Programmming.pptx
Prashant416351
 
What is java
What is javaWhat is java
What is java
javaicon
 
Java Technologies notes of unit 1 and 2.
Java Technologies notes of unit 1 and 2.Java Technologies notes of unit 1 and 2.
Java Technologies notes of unit 1 and 2.
sumanyadavdpg
 
Java Fundamentals in Mule
Java Fundamentals in MuleJava Fundamentals in Mule
Java Fundamentals in Mule
Anand kalla
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
TIB Academy
 
java introduction.docx
java introduction.docxjava introduction.docx
java introduction.docx
vikasbagra9887
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
sanjay joshi
 
2 22CA026_Advance Java Programming_Data types and Operators.pptx
2 22CA026_Advance Java Programming_Data types and Operators.pptx2 22CA026_Advance Java Programming_Data types and Operators.pptx
2 22CA026_Advance Java Programming_Data types and Operators.pptx
dolphiverma80
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Phaniu
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
javeed_mhd
 
Java Basics
Java BasicsJava Basics
Java Basics
Khan625
 
Java Basics in Mule
Java Basics in MuleJava Basics in Mule
Java Basics in Mule
Rajkattamuri
 
Ad

More from eleksdev (20)

Communication in android
Communication in androidCommunication in android
Communication in android
eleksdev
 
Hello android world
Hello android worldHello android world
Hello android world
eleksdev
 
Angular. presentation
Angular. presentationAngular. presentation
Angular. presentation
eleksdev
 
Android location and sensors API
Android location and sensors APIAndroid location and sensors API
Android location and sensors API
eleksdev
 
Frontend basics
Frontend basicsFrontend basics
Frontend basics
eleksdev
 
Advanced styles
Advanced stylesAdvanced styles
Advanced styles
eleksdev
 
Css animation, html5 api
Css animation, html5 apiCss animation, html5 api
Css animation, html5 api
eleksdev
 
Improving rpc bkp
Improving rpc bkpImproving rpc bkp
Improving rpc bkp
eleksdev
 
G rpc lection1_theory_bkp2
G rpc lection1_theory_bkp2G rpc lection1_theory_bkp2
G rpc lection1_theory_bkp2
eleksdev
 
G rpc lection1
G rpc lection1G rpc lection1
G rpc lection1
eleksdev
 
Windows service
Windows serviceWindows service
Windows service
eleksdev
 
Rpc
RpcRpc
Rpc
eleksdev
 
DAL
DALDAL
DAL
eleksdev
 
Aspnet core
Aspnet coreAspnet core
Aspnet core
eleksdev
 
Web service lecture
Web service lectureWeb service lecture
Web service lecture
eleksdev
 
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
eleksdev
 
SDLC. QA Role
SDLC. QA RoleSDLC. QA Role
SDLC. QA Role
eleksdev
 
SDLC. UX Role
SDLC. UX RoleSDLC. UX Role
SDLC. UX Role
eleksdev
 
SDLC. PM Role
SDLC. PM RoleSDLC. PM Role
SDLC. PM Role
eleksdev
 
SDLC. BA Role
SDLC. BA RoleSDLC. BA Role
SDLC. BA Role
eleksdev
 
Communication in android
Communication in androidCommunication in android
Communication in android
eleksdev
 
Hello android world
Hello android worldHello android world
Hello android world
eleksdev
 
Angular. presentation
Angular. presentationAngular. presentation
Angular. presentation
eleksdev
 
Android location and sensors API
Android location and sensors APIAndroid location and sensors API
Android location and sensors API
eleksdev
 
Frontend basics
Frontend basicsFrontend basics
Frontend basics
eleksdev
 
Advanced styles
Advanced stylesAdvanced styles
Advanced styles
eleksdev
 
Css animation, html5 api
Css animation, html5 apiCss animation, html5 api
Css animation, html5 api
eleksdev
 
Improving rpc bkp
Improving rpc bkpImproving rpc bkp
Improving rpc bkp
eleksdev
 
G rpc lection1_theory_bkp2
G rpc lection1_theory_bkp2G rpc lection1_theory_bkp2
G rpc lection1_theory_bkp2
eleksdev
 
G rpc lection1
G rpc lection1G rpc lection1
G rpc lection1
eleksdev
 
Windows service
Windows serviceWindows service
Windows service
eleksdev
 
Aspnet core
Aspnet coreAspnet core
Aspnet core
eleksdev
 
Web service lecture
Web service lectureWeb service lecture
Web service lecture
eleksdev
 
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
eleksdev
 
SDLC. QA Role
SDLC. QA RoleSDLC. QA Role
SDLC. QA Role
eleksdev
 
SDLC. UX Role
SDLC. UX RoleSDLC. UX Role
SDLC. UX Role
eleksdev
 
SDLC. PM Role
SDLC. PM RoleSDLC. PM Role
SDLC. PM Role
eleksdev
 
SDLC. BA Role
SDLC. BA RoleSDLC. BA Role
SDLC. BA Role
eleksdev
 
Ad

Recently uploaded (20)

AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 

Lecture java basics

  • 1. Java Basics by Yuriy Voznyak, Software Engineer eleks.com
  • 2. Lecture Goal or Why Java? ● Become familiar with one more great platform; ● Introduction to Android development; ● Understand the difference between Java and another popular languages such as C# or C++ ● 30 Billion Devices ● ...
  • 3. Why did Java invent? 1. Write Once, Run Everywhere. This old Sun slogan describes very ambitious goal. Sun wanted to create cross-platform language; 2. Java Virtual Machine should run every application in the separate sandbox with dedicated permission; So, applications and environment should provide better security than with using of unmanaged code 3. Easy distribution over Internet as Java applications or Java Applets; 4. Built-in Multithreading support; 5. To replace C/C++ with a better design;
  • 4. What do I need for Java? ● If I want to run Java applications on Desktop, there is a JRE (Java Runtime Environment); ● For servers there is another JRE - Server JRE (Server Java Runtime Environment). Contains tools for JVM monitoring and some tools required for server applications, but does not include browser integration (the Java plug-in), auto-update, nor an installer; ● I want to develop Java Software: need Oracle JDK (Java Development Kit). Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications; ● I want to learn Java deeper or have some extra needs: there is open-source Java implementation called OpenJDK.
  • 5. Java Editions Java Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as embedded environments. Most common used. Java Enterprise Edition (Java EE) Extended overset of java engine, contains specifications for designing and developing of Big Enterprise Network Applications Java Micro Edition (Java ME) a subset of Java, designed for devices with limited hardware characteristics. Java Embedded Edition Oracle`s marketing term. Contain some binaries to work with Raspberry Pi or ARM devboards Java DB Just a implementation of open-source database engine Java Card Technology to develop Smart Cards secure applets. Sooo limited and low-level Marketing sets Specialized
  • 7. Noticeable Java Feature Differences ● Syntax is a bit simpler. Really ● Packages instead of namespaces ● No default values ● Values are passed by value only. But, for reference types, value is reference. So, you just pass copy of the reverence: is able to modify but unable to assign another reference; ● Methods names begin from capital letter :) ● Observer patterns everywhere with anonymous classes ● Java runs not only on Windows ● Less syntax sugar
  • 8. Main Method C# static void Main(string[] args) … or even static void Main() Java public static void main(String[] args)
  • 10. Declaring Constants C# const int Constant = 42; Java [public] static final int CONSTANT = 42;
  • 11. Inheritance C# class Child : Parent, IDerivable { ... } Java class Child extends Parent implements Derivable { ... }
  • 14. Primitive Types type size range default value wrapper byte 1 From +127 to -128 0 Byte short 2 From +32,767 to -32,768 0 Short int 4 From +2,147,483,647 to -2,147,483,648 0 Integer long 8 From +9,223,372,036,854,775,807 to - 9,223,372,036,854,775,808 0L Long float 4 From 3.402,823,5 E+38 to 1.4 E-45 0.0f Float double 8 From 1.797,693,134,862,315,7 E+308 to 4.9 E-324 0.0d Double char 2 All Unicode characters 'u0000' Character boolean 1 False, true false Boolean
  • 15. Moar Difference ● In Java methods are virtual by default but you can make them final. (In C# they are sealed by default, but you can make them virtual.) ● Generics are completely different between the two; Java generics are just a compile-time "trick" (but a useful one at that). In C# and .NET generics are maintained at execution time too, and work for value types as well as reference types. ● Java doesn't allow the creation of user-defined value types ● Java doesn't support overloading ● Java doesn't have anything like LINQ ● Partly due to not having delegates, Java doesn't have anything quite like anonymous methods and lambda expressions (in Java 8 does). Anonymous inner classes usually fill these roles. ● Java doesn't have implicitly typed local variables (var directive)
  • 16. Please, stop! ● Java doesn't have extension methods ● The access modifiers are somewhat different - in Java there's (currently) no direct equivalent of an assembly, so no idea of "internal" visibility; ● Java doesn't have the equivalent of "unsafe" code ● Java has no preprocessor directives (#define, #if etc) ● Java has no equivalent of C#'s ref and out for passing parameters by reference ● Java has no equivalent of partial types ● Java has no unsigned integer types ● Java has no language support for a decimal type. However, java.math.BigDecimal provides similar functionality ● Java has no equivalent of nullable value types ● Java doesn't have static classes (which don't have any instance constructors, and can't be used for variables, parameters etc)
  • 17. Is it all? Of course, no. However… ● in C# there's no equivalent to the "default" visibility in Java which takes account of namespace ● C# interfaces cannot declare fields. In java interfaces can contain static final fields and even implementation (sic!) ● C# doesn't have checked exceptions ● C# doesn't have anonymous inner classes ● C# doesn't have Java's inner classes at all, in fact - all nested classes in C# are like Java's static nested classes
  • 18. How to write Java application? 1. 2.
  • 19. What is Jar JAR file is a file format based on the popular ZIP file format and is used for aggregating many files into one. A JAR file is essentially a zip file that contains an optional META-INF directory. A JAR file can be created by the command-line jar tool, or by using the java.util.jar API in the Java platform. There is no restriction on the name of a JAR file, it can be any legal file name on a particular platform. In many cases, JAR files are not just simple archives of java classes files and/or resources. They are used as building blocks for applications and extensions. The META-INF directory, if it exists, is used to store package and extension configuration data, including security, versioning, extension and services.
  • 20. Designing Classes Structure explicit-representation principle: classes included to reflect natural categories; no-duplication principle: member functions situated among class definitions to facilitate sharing; local-view principle: program elements placed to make it easy to see how the elements interact; look-it-up principle: class definitions including member variables for stable, frequently requested information; need-to-know principle, with public interfaces designed to restrict member-variable and member-function access, thus facilitating the improvement and maintenance of nonpublic program elements; keep-it-simple principle: class and function definitions are broken up when these definitions become too complex to understand; modularity principle, with program elements divided into logically coherent modules.
  • 21. Where to Read More 1. Documentation 2. Books 3. Internet 4. Source Code
  • 23. Inspired by Technology. Driven by Value. Find us at eleks.com Have a question? Write to [email protected]

Editor's Notes

  • #3: Java is not number one in Eleks though.
  • #4: Java is not number one in Eleks though.
  • #5: Java is not number one in Eleks though.
  • #14: No tuple