SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
Java Fundamentals
Sohail Shaghasi
sohail.shaghasi@gmail.com
Course Overview
 What is computer program?
 What is high level and low level language?
 Introduction to Java.
 What is an IDE?
 How Java program Gets executed (Java life cycle)?
 What is Variable?
 What is Variable Scope?
 What is Constant?
sohail.shaghasi@gmail.com
Course Overview Cont.
 What is Operator?
 What is primitive type?
 What is String?
 What is array?
 What are control statements (if / else, Switch , For, while, Break/Continue)?
 What is function/Method?
 What is Class ?
 What is Constructor?
 What is Object ?
 What is Access Modifiers?
 What is OOP?
 Pillars of OOP
sohail.shaghasi@gmail.com
What is Computer Program?
 Program is a set of instruction given to a computer to perform a specific task.
 Some examples of computer programs:
 A web browser like Mozilla Firefox and Apple Safari can be used to view web pages
on the Internet.
 An office suite can be used to write documents or spreadsheets.
 Video games are computer programs.
sohail.shaghasi@gmail.com
What is High level and Low Level
language?
 Characteristics of High level languages:
 Easier to understand and user friendly.
 Extremely portable.
 Can be debugged in an easier manner.
 Characteristics of Low level language:
 Extremely difficult to understand.
 Nearer to Machine code.
 Appropriate for developing new operating system.
 Appropriate for microcontrollers programming.
sohail.shaghasi@gmail.com
Introduction to Java
 Programming language based on C and C++.
 Designed to be written once and run anywhere (cross platform).
 Runs on virtual machine.
 Very similar to C#.
 Java is Object Oriented.
sohail.shaghasi@gmail.com
What is an IDE?
 IDE means
 Integrated Development Environment.
 An IDE is software application.
 Eclipse, Netbeans and Microsoft Visual studio are IDEs.
 You can do many things using IDE
 Implement databases.
 Design User interfaces.
 Program an application.
 Compile/build an application
 Test an application.
 Debug an application.
 Diagraming.
sohail.shaghasi@gmail.com
Java life Cycle
 How Java program gets executed?
sohail.shaghasi@gmail.com
What is Variable?
sohail.shaghasi@gmail.com
 Just like a variable in a math equation
 1 + 3 = 4
 1 + x = ?
 Without variables programs would be non-interactive
 Variables allow us to store data in our program
 Opposite of a constant
 The number 3 is a constant
 X is a variable
Syntax:
What is Variable Scope?
 Global Variables:
 Declared outside any function.
 Local Variable:
 Declare inside a function.
 To simplify things, just think of the scope as anything
between the curly braces {…}. The outer curly braces are
called the outer blocks , and the inner curly braces are
called inner blocks.
sohail.shaghasi@gmail.com
What is constant?
 It is a variable whose value can’t change.
sohail.shaghasi@gmail.com
What is Operator?
 Assignment
 =
 +=
 -=
 *=
 /=
 %=
sohail.shaghasi@gmail.com
Operators Cont
 Relational
 >
 <
 >=
 <=
 ==
 !=
sohail.shaghasi@gmail.com
Operators Cont.
 Logical
 &&
 ||
 !
sohail.shaghasi@gmail.com
What are primitive types?
What is Array?
 An array is a group of contiguous or related data items that share a common name.
 Used when programs have to handle large amount of data
 Each value is stored at a specific position
 Position is called a index or superscript. Base index = 0
sohail.shaghasi@gmail.com
69
61
70
89
23
10
9
0
1
2
3
4
5
6
index
values
Array Cont.
 Like any other variables, arrays must declared and created before
they can be used. Creation of arrays involve three steps:
 Declare the array
 Create storage area in primary memory.
 Put values into the array (i.e., Memory location)
 String[] students = new String[10];
 String[] students = new String []{‘st1’, ‘st2’, ‘st3’};
sohail.shaghasi@gmail.com
What are Control statements?
 if else
 switch
 while
 do while
 For
 For Each
 break
 continue
sohail.shaghasi@gmail.com
If - else
if(conditional_statement)
{
statement to be executed if conditional_statement becomes true
}
Else
{
statements to be executed if the above conditional_statement
becomes false
}
sohail.shaghasi@gmail.com
Switch
switch (n)
{
case expression1:
// code to be executed if n is equal to expression1;
break;
case expression :
// code to be executed if n is equal to expression1;
break;
default:
// code to be executed if n doesn't match any expression1
}
sohail.shaghasi@gmail.com
Switch statement Flowchart
sohail.shaghasi@gmail.com
While loop
while(condition_statementtrue)
{
Statements to be executed when the condition becomes true and execute
them repeatedly until condition_statement becomes false.
}
E.g.
int x = 2;
while(x>5){
system.out.println(“value of x:”+x);
x++;
}
sohail.shaghasi@gmail.com
Do while loop
do
{
statements to be executed at least once without looking at the condition.
The statements will be executed until the condition becomes true.
}
while(condition_statement);
sohail.shaghasi@gmail.com
Comparing while and do-while loops
sohail.shaghasi@gmail.com
For loop
for(initialization; condition; increment/decrement){
statements to be executed until the condition becomes false
}
E.g:
for(int x = 0; x < 10; x++)
{
System.out.println(“value of x:”+x);
}
sohail.shaghasi@gmail.com
Break
 Break is used in the loops and when executed, the control of the execution will come out of the
loop.
E.g:
for(int i=1;i<50;i++)
{
if(i%11==0)
{
System.out.println(“Before breaking the loop”);
break;
}
System.out.println(“Value of i:”+i );
}
sohail.shaghasi@gmail.com
Continue
 Continue makes the loop to skip the current execution and continues with the next iteration.
E.g:
for(int i=1;i<50;i++)
{
if(i%11==0)
{
System.out.println(“Before breaking the loop”);
continue;
}
System.out.println(“Value of i:”+i );
}
sohail.shaghasi@gmail.com
What is function/Method?
 A function is section of a program that has a name and performs a specific
task.
 Function definition:
 Return Type − A function may return a value
 Function Name − This is the actual name of the function.
 Parameter List − A parameter is like a placeholder. When a function is
invoked, you pass a value as a parameter.
 Function Body − collection of statements that describes what the function
does.
sohail.shaghasi@gmail.com
Function Cont.
sohail.shaghasi@gmail.com
Access
Modifier
Return
type
Function
name
Method body
parameters
return
What is Class?
 Class can be thought of as a template, a prototype or a blueprint of an
object.
 It is a fundamental structure in Object oriented programming.
 Two types of class members:
 Fields (properties or attributes)
 Methods
 Specify the operations.
sohail.shaghasi@gmail.com
What is Constructor?
 Constructor is a method where you place all the initialization, it has the same
name as the class.
 When you create an object, you actually invoke the class constructor.
 “new” Operator
 Allocated a memory for that object and returns a reference of that memory
location to you.
 “Dot” operator
 It allows you to access public properties and public methods of a respective
class.
sohail.shaghasi@gmail.com
Constructor cont.
sohail.shaghasi@gmail.com
What is Object?
 An object is an instance of a class.
 To create an object the ‘new’ operator is used.
 For example if you want to create an instance of class String, we write the
following code,
 String str = new String(“Hello World”);
 Or also equivalent to
 String str = “Hello World”;
sohail.shaghasi@gmail.com
Object cont.
sohail.shaghasi@gmail.com Object
What are Access Modifiers?
Access
Modifier
within class within package outside
package by
subclass only
outside
package
Private Yes No No No
Default Yes Yes No No
Protected Yes Yes Yes No
Public Yes Yes Yes Yes
sohail.shaghasi@gmail.com
What is OOP?
 object-oriented programming:
 A programming paradigm where a software system is represented as a
collection of objects that interact with each other to solve the overall task.
sohail.shaghasi@gmail.com
Four Pillars of OOP
 Object-oriented programming is based on these 4 pillar:
 Abstraction
 Polymorphism
 Inheritance
 Encapsulation
sohail.shaghasi@gmail.com
APIE
Abstraction
 In java, we can have an abstract class without any abstract method. This
allow us to create classes that cannot be instantiated, but can only be
inherited.
 Abstract classes cannot be instantiated, means we cant create object to
Abstract class.
 We can create subclasses to Abstract classes.
sohail.shaghasi@gmail.com
Polymorphism
sohail.shaghasi@gmail.com
 Polymorphism is the capability of a method to do different things based on
the object.
Inheritance
 One of the most effective feature of OOP paradigm.
 Establish link/connectivity between 2 or more classes.
 Permits sharing and accessing properties from one to another class.
 To establish this relation java uses ‘extends’ keyword.
sohail.shaghasi@gmail.com
Encapsulation
 Encapsulation is the technique of making the fields in a class private and
providing access to the fields via public methods.
 If a field is declared private, it cannot be accessed by outside classes.
 Encapsulation is referred to as data hiding.
sohail.shaghasi@gmail.com

Mais conteúdo relacionado

Mais procurados

Java object oriented programming concepts - Brainsmartlabs
Java object oriented programming concepts - BrainsmartlabsJava object oriented programming concepts - Brainsmartlabs
Java object oriented programming concepts - Brainsmartlabsbrainsmartlabsedu
 
Core java Basics
Core java BasicsCore java Basics
Core java BasicsRAMU KOLLI
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingPurvik Rana
 
Functional Programming In Jdk8
Functional Programming In Jdk8 Functional Programming In Jdk8
Functional Programming In Jdk8 Bansilal Haudakari
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and InterfaceHaris Bin Zahid
 
C# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringC# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringEyob Lube
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statementsİbrahim Kürce
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with javaHawkman Academy
 
Java 201 Intro to Test Driven Development in Java
Java 201   Intro to Test Driven Development in JavaJava 201   Intro to Test Driven Development in Java
Java 201 Intro to Test Driven Development in Javaagorolabs
 
Basic elements of java
Basic elements of java Basic elements of java
Basic elements of java Ahmad Idrees
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programmingnirajmandaliya
 

Mais procurados (13)

Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Java object oriented programming concepts - Brainsmartlabs
Java object oriented programming concepts - BrainsmartlabsJava object oriented programming concepts - Brainsmartlabs
Java object oriented programming concepts - Brainsmartlabs
 
Core java Basics
Core java BasicsCore java Basics
Core java Basics
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
 
Functional Programming In Jdk8
Functional Programming In Jdk8 Functional Programming In Jdk8
Functional Programming In Jdk8
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and Interface
 
C# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringC# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoring
 
Java notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esectionJava notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esection
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with java
 
Java 201 Intro to Test Driven Development in Java
Java 201   Intro to Test Driven Development in JavaJava 201   Intro to Test Driven Development in Java
Java 201 Intro to Test Driven Development in Java
 
Basic elements of java
Basic elements of java Basic elements of java
Basic elements of java
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
 

Destaque

How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 
Irelands Inspiration For Tomorrow
Irelands Inspiration For TomorrowIrelands Inspiration For Tomorrow
Irelands Inspiration For TomorrowMichael Browne
 
A short introduction of D3js
A short introduction of D3jsA short introduction of D3js
A short introduction of D3jsdreampuf
 
Introduction to d3js (and SVG)
Introduction to d3js (and SVG)Introduction to d3js (and SVG)
Introduction to d3js (and SVG)zahid-mian
 
Object relationship model of software engineering,a subtopic of object orient...
Object relationship model of software engineering,a subtopic of object orient...Object relationship model of software engineering,a subtopic of object orient...
Object relationship model of software engineering,a subtopic of object orient...julia121214
 
Object Oriented Relationships
Object Oriented RelationshipsObject Oriented Relationships
Object Oriented RelationshipsTaher Barodawala
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux IntroductionNikolaus Graf
 
25 Employee Engagement Ideas
25 Employee Engagement Ideas25 Employee Engagement Ideas
25 Employee Engagement IdeasHppy
 
15 Employee Engagement activities that you can start doing now
15 Employee Engagement activities that you can start doing now15 Employee Engagement activities that you can start doing now
15 Employee Engagement activities that you can start doing nowHppy
 
Research assumption
Research assumptionResearch assumption
Research assumptionNursing Path
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 

Destaque (16)

How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Irelands Inspiration For Tomorrow
Irelands Inspiration For TomorrowIrelands Inspiration For Tomorrow
Irelands Inspiration For Tomorrow
 
A short introduction of D3js
A short introduction of D3jsA short introduction of D3js
A short introduction of D3js
 
Introduction to d3js (and SVG)
Introduction to d3js (and SVG)Introduction to d3js (and SVG)
Introduction to d3js (and SVG)
 
Object relationship model of software engineering,a subtopic of object orient...
Object relationship model of software engineering,a subtopic of object orient...Object relationship model of software engineering,a subtopic of object orient...
Object relationship model of software engineering,a subtopic of object orient...
 
Object Oriented Relationships
Object Oriented RelationshipsObject Oriented Relationships
Object Oriented Relationships
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Android Booting Scenarios
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
Self Motivation
 Self Motivation Self Motivation
Self Motivation
 
25 Employee Engagement Ideas
25 Employee Engagement Ideas25 Employee Engagement Ideas
25 Employee Engagement Ideas
 
15 Employee Engagement activities that you can start doing now
15 Employee Engagement activities that you can start doing now15 Employee Engagement activities that you can start doing now
15 Employee Engagement activities that you can start doing now
 
Employee Engagement
Employee EngagementEmployee Engagement
Employee Engagement
 
Employee engagement
Employee engagementEmployee engagement
Employee engagement
 
Research assumption
Research assumptionResearch assumption
Research assumption
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Semelhante a Java fundamentals

Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java MayaTofik
 
C# interview-questions
C# interview-questionsC# interview-questions
C# interview-questionsnicolbiden
 
Internet programming slide - java.ppt
Internet programming slide - java.pptInternet programming slide - java.ppt
Internet programming slide - java.pptMikeAdva
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternNishith Shukla
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsLalit Kale
 
06 abstract-classes
06 abstract-classes06 abstract-classes
06 abstract-classesAnup Burange
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Courseparveen837153
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answersKrishnaov
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaSujit Majety
 
Patterns in Python
Patterns in PythonPatterns in Python
Patterns in Pythondn
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming ParadigmsDirecti Group
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshowilias ahmed
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming ParadigmsJaneve George
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy CodeNaresh Jain
 
Core Java Basics
Core Java BasicsCore Java Basics
Core Java BasicsFayis-QA
 
Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programmingsamthemonad
 

Semelhante a Java fundamentals (20)

Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
 
C# interview-questions
C# interview-questionsC# interview-questions
C# interview-questions
 
Oop java
Oop javaOop java
Oop java
 
Internet programming slide - java.ppt
Internet programming slide - java.pptInternet programming slide - java.ppt
Internet programming slide - java.ppt
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design Pattern
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design Patterns
 
06 abstract-classes
06 abstract-classes06 abstract-classes
06 abstract-classes
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Course
 
11.Object Oriented Programming.pdf
11.Object Oriented Programming.pdf11.Object Oriented Programming.pdf
11.Object Oriented Programming.pdf
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Patterns in Python
Patterns in PythonPatterns in Python
Patterns in Python
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
 
Core Java Basics
Core Java BasicsCore Java Basics
Core Java Basics
 
Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programming
 
Java Basics
Java BasicsJava Basics
Java Basics
 

Último

LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0DanBrown980551
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTopCSSGallery
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechProduct School
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1DianaGray10
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsDianaGray10
 
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4DianaGray10
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNeo4j
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kitJamie (Taka) Wang
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)IES VE
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIVijayananda Mohire
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdfThe Good Food Institute
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and businessFrancesco Corti
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3DianaGray10
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox
 
Technical SEO for Improved Accessibility WTS FEST
Technical SEO for Improved Accessibility  WTS FESTTechnical SEO for Improved Accessibility  WTS FEST
Technical SEO for Improved Accessibility WTS FESTBillieHyde
 

Último (20)

LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
 
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile Brochure
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4j
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kit
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAI
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and business
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
SheDev 2024
SheDev 2024SheDev 2024
SheDev 2024
 
UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
 
Technical SEO for Improved Accessibility WTS FEST
Technical SEO for Improved Accessibility  WTS FESTTechnical SEO for Improved Accessibility  WTS FEST
Technical SEO for Improved Accessibility WTS FEST
 

Java fundamentals

  • 2. Course Overview  What is computer program?  What is high level and low level language?  Introduction to Java.  What is an IDE?  How Java program Gets executed (Java life cycle)?  What is Variable?  What is Variable Scope?  What is Constant? sohail.shaghasi@gmail.com
  • 3. Course Overview Cont.  What is Operator?  What is primitive type?  What is String?  What is array?  What are control statements (if / else, Switch , For, while, Break/Continue)?  What is function/Method?  What is Class ?  What is Constructor?  What is Object ?  What is Access Modifiers?  What is OOP?  Pillars of OOP sohail.shaghasi@gmail.com
  • 4. What is Computer Program?  Program is a set of instruction given to a computer to perform a specific task.  Some examples of computer programs:  A web browser like Mozilla Firefox and Apple Safari can be used to view web pages on the Internet.  An office suite can be used to write documents or spreadsheets.  Video games are computer programs. sohail.shaghasi@gmail.com
  • 5. What is High level and Low Level language?  Characteristics of High level languages:  Easier to understand and user friendly.  Extremely portable.  Can be debugged in an easier manner.  Characteristics of Low level language:  Extremely difficult to understand.  Nearer to Machine code.  Appropriate for developing new operating system.  Appropriate for microcontrollers programming. sohail.shaghasi@gmail.com
  • 6. Introduction to Java  Programming language based on C and C++.  Designed to be written once and run anywhere (cross platform).  Runs on virtual machine.  Very similar to C#.  Java is Object Oriented. sohail.shaghasi@gmail.com
  • 7. What is an IDE?  IDE means  Integrated Development Environment.  An IDE is software application.  Eclipse, Netbeans and Microsoft Visual studio are IDEs.  You can do many things using IDE  Implement databases.  Design User interfaces.  Program an application.  Compile/build an application  Test an application.  Debug an application.  Diagraming. sohail.shaghasi@gmail.com
  • 8. Java life Cycle  How Java program gets executed? sohail.shaghasi@gmail.com
  • 9. What is Variable? sohail.shaghasi@gmail.com  Just like a variable in a math equation  1 + 3 = 4  1 + x = ?  Without variables programs would be non-interactive  Variables allow us to store data in our program  Opposite of a constant  The number 3 is a constant  X is a variable Syntax:
  • 10. What is Variable Scope?  Global Variables:  Declared outside any function.  Local Variable:  Declare inside a function.  To simplify things, just think of the scope as anything between the curly braces {…}. The outer curly braces are called the outer blocks , and the inner curly braces are called inner blocks. sohail.shaghasi@gmail.com
  • 11. What is constant?  It is a variable whose value can’t change. sohail.shaghasi@gmail.com
  • 12. What is Operator?  Assignment  =  +=  -=  *=  /=  %= sohail.shaghasi@gmail.com
  • 13. Operators Cont  Relational  >  <  >=  <=  ==  != sohail.shaghasi@gmail.com
  • 14. Operators Cont.  Logical  &&  ||  ! sohail.shaghasi@gmail.com
  • 16. What is Array?  An array is a group of contiguous or related data items that share a common name.  Used when programs have to handle large amount of data  Each value is stored at a specific position  Position is called a index or superscript. Base index = 0 sohail.shaghasi@gmail.com 69 61 70 89 23 10 9 0 1 2 3 4 5 6 index values
  • 17. Array Cont.  Like any other variables, arrays must declared and created before they can be used. Creation of arrays involve three steps:  Declare the array  Create storage area in primary memory.  Put values into the array (i.e., Memory location)  String[] students = new String[10];  String[] students = new String []{‘st1’, ‘st2’, ‘st3’}; sohail.shaghasi@gmail.com
  • 18. What are Control statements?  if else  switch  while  do while  For  For Each  break  continue sohail.shaghasi@gmail.com
  • 19. If - else if(conditional_statement) { statement to be executed if conditional_statement becomes true } Else { statements to be executed if the above conditional_statement becomes false } sohail.shaghasi@gmail.com
  • 20. Switch switch (n) { case expression1: // code to be executed if n is equal to expression1; break; case expression : // code to be executed if n is equal to expression1; break; default: // code to be executed if n doesn't match any expression1 } sohail.shaghasi@gmail.com
  • 22. While loop while(condition_statementtrue) { Statements to be executed when the condition becomes true and execute them repeatedly until condition_statement becomes false. } E.g. int x = 2; while(x>5){ system.out.println(“value of x:”+x); x++; } sohail.shaghasi@gmail.com
  • 23. Do while loop do { statements to be executed at least once without looking at the condition. The statements will be executed until the condition becomes true. } while(condition_statement); sohail.shaghasi@gmail.com
  • 24. Comparing while and do-while loops sohail.shaghasi@gmail.com
  • 25. For loop for(initialization; condition; increment/decrement){ statements to be executed until the condition becomes false } E.g: for(int x = 0; x < 10; x++) { System.out.println(“value of x:”+x); } sohail.shaghasi@gmail.com
  • 26. Break  Break is used in the loops and when executed, the control of the execution will come out of the loop. E.g: for(int i=1;i<50;i++) { if(i%11==0) { System.out.println(“Before breaking the loop”); break; } System.out.println(“Value of i:”+i ); } sohail.shaghasi@gmail.com
  • 27. Continue  Continue makes the loop to skip the current execution and continues with the next iteration. E.g: for(int i=1;i<50;i++) { if(i%11==0) { System.out.println(“Before breaking the loop”); continue; } System.out.println(“Value of i:”+i ); } sohail.shaghasi@gmail.com
  • 28. What is function/Method?  A function is section of a program that has a name and performs a specific task.  Function definition:  Return Type − A function may return a value  Function Name − This is the actual name of the function.  Parameter List − A parameter is like a placeholder. When a function is invoked, you pass a value as a parameter.  Function Body − collection of statements that describes what the function does. sohail.shaghasi@gmail.com
  • 30. What is Class?  Class can be thought of as a template, a prototype or a blueprint of an object.  It is a fundamental structure in Object oriented programming.  Two types of class members:  Fields (properties or attributes)  Methods  Specify the operations. sohail.shaghasi@gmail.com
  • 31. What is Constructor?  Constructor is a method where you place all the initialization, it has the same name as the class.  When you create an object, you actually invoke the class constructor.  “new” Operator  Allocated a memory for that object and returns a reference of that memory location to you.  “Dot” operator  It allows you to access public properties and public methods of a respective class. sohail.shaghasi@gmail.com
  • 33. What is Object?  An object is an instance of a class.  To create an object the ‘new’ operator is used.  For example if you want to create an instance of class String, we write the following code,  String str = new String(“Hello World”);  Or also equivalent to  String str = “Hello World”; sohail.shaghasi@gmail.com
  • 35. What are Access Modifiers? Access Modifier within class within package outside package by subclass only outside package Private Yes No No No Default Yes Yes No No Protected Yes Yes Yes No Public Yes Yes Yes Yes sohail.shaghasi@gmail.com
  • 36. What is OOP?  object-oriented programming:  A programming paradigm where a software system is represented as a collection of objects that interact with each other to solve the overall task. sohail.shaghasi@gmail.com
  • 37. Four Pillars of OOP  Object-oriented programming is based on these 4 pillar:  Abstraction  Polymorphism  Inheritance  Encapsulation sohail.shaghasi@gmail.com APIE
  • 38. Abstraction  In java, we can have an abstract class without any abstract method. This allow us to create classes that cannot be instantiated, but can only be inherited.  Abstract classes cannot be instantiated, means we cant create object to Abstract class.  We can create subclasses to Abstract classes. sohail.shaghasi@gmail.com
  • 39. Polymorphism sohail.shaghasi@gmail.com  Polymorphism is the capability of a method to do different things based on the object.
  • 40. Inheritance  One of the most effective feature of OOP paradigm.  Establish link/connectivity between 2 or more classes.  Permits sharing and accessing properties from one to another class.  To establish this relation java uses ‘extends’ keyword. sohail.shaghasi@gmail.com
  • 41. Encapsulation  Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods.  If a field is declared private, it cannot be accessed by outside classes.  Encapsulation is referred to as data hiding. sohail.shaghasi@gmail.com