SlideShare a Scribd company logo
1 of 40
Download to read offline
AI Programming
with JAVA
By:Virat Andodariya
M.S.University
1
How Artificial Intelligence Programmed?
Java Basics
Graph coloring Problem
Uniform Cost Search
Contents
2
How Artificial Intelligence Programmed?
C++
C#
Java
Lisp
Python
3
Java Basics
• The Java Virtual Machine
• Applications & Applets
• Classes & Objects
• Start up Java
• Variables & Assignments
• Strings & Characters
• Arithmetic Operators & Expressions
• Comments
• Keywords
• Creating and Compiling Programs
• Modifiers
4
Bytecodes and the Java Virtual Machine
5
Java Program
• Java Application Program
– Application
• Program written in general programming language
– Applet
• Program running in Web Browser Environment
• Can be viewed by appletviewer or Web browser with
JVM
6
Classes and Objects
• Object
– Memory Space to Define State and Operation
– Instance of Class
• Class
– A class is a template or blueprint for objects. To program in
Java, you must understand classes and be able to write and
use them.
– Template of Creating Object
7
The Java Class Libraries
• java.applet : Applet related
• java.awt : Abstract Window Toolkit
• java.awt.event : Event process from awt component
• java.awt.image : Image processing
• java.beans : JavaBeans Component
• java.io : File or Network I/O Support
• java.lang : Java Language Support
• java.net : Network related functions
• java.util : Utility function
8
Start a Java Application
9
Variables and Assignments
• Types
– char 16bits Unicode character data
– boolean Boolean Variable
– byte 8 bits signed integer
– short 16 bits signed integer
– int 32 bits signed integer
– long 64 bits signed integer
– float 32 bits signed floating point number
– double 64 bits signed floating point number
10
Variables and Assignments
• String : sequence of character
String s = “Enter an integer value: ” ;
• Concatenation Operator ‘+’
String s = “Lincoln said: ” + “” Four score and seven years
ago”” ;
Result :
Lincoln said: “Four score and seven years ago”
11
Comments
• Single Line Comment
– int i = 10 ; // i is counter
• Multiple Line Comment
/*
Some comments
*/
• Documentation Comment
/**
Documentation Comment
*/
12
Java Keywords
• 50 Java Keywords
abstract double int super
boolean else interface s witch
break extends long synchronized
byte final native this
case finally new throw
catch float package throws
char for private transient*
class goto* protected try
const* if public void
continue implements return volatile
default import short while
do instanceof static strictfp
assert (New in 1.5) enum (New in 1.5)
13
Control Statement
• A statement represents an action or a sequence of actions.
To change the execution order of program
• As the method of controlling the execution order
– Conditional Statement : if St., switch St.
– Repeat Statement : for St., while St., do-while St.
– Branch Statement : break St., continue St., return St.
14
For Statement
 Repeat the sequence of statement as many as defined.
 Form of for statement
for ( <expr. 1> ; < expr. 2> ; < expr. 3>)
<statement>
 <expr. 1> : initialize the control variable
 <expr. 2> : check the control variable
 <expr. 3> : modify the control variable
s = 0;
for (i=1; i<=N; ++i) // sum from 1 to N : i increment
s += i;
15
Break Statement
• To move control to the out of the block
• From of break statement
break [label] ;
16
Source Code
Create/Modify Source Code
Compile Source Code
i.e. javac Welcome.java
Bytecode
Run Byteode
i.e. java Welcome
Result
If compilation errors
If runtime errors or incorrect result
17
Modifiers
Java uses certain reserved words called modifiers that specify
the properties of the data, methods, and classes and how
they can be used.
Examples of modifiers are public and static. Other modifiers are
private, final, abstract, and protected. A public datum,
method, or class can be accessed by other programs. A
private datum or method cannot be accessed by other
programs.
18
Graph coloring Problem
Graph In Matrix
19
Graph Coloring
20
21
22
23
24
Result
25
UniformCostSearch
26
27
28
29
30
31
32
33
34
35
36
37
38
References
• Java™ 2:The Complete Reference,Fifth Edition
Herbert Schildt
• JDK Developer Kit
• JGRASP (CSD) Compiler
39
Thank you
40

More Related Content

What's hot

What's hot (20)

IoT
IoTIoT
IoT
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
What is IoT | The Structure of IoT | Future of IoT
What is IoT | The Structure of IoT | Future of IoTWhat is IoT | The Structure of IoT | Future of IoT
What is IoT | The Structure of IoT | Future of IoT
 
Observer & singleton pattern
Observer  & singleton patternObserver  & singleton pattern
Observer & singleton pattern
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsPython Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
ML_ Unit 2_Part_B
ML_ Unit 2_Part_BML_ Unit 2_Part_B
ML_ Unit 2_Part_B
 
Android - Android Intent Types
Android - Android Intent TypesAndroid - Android Intent Types
Android - Android Intent Types
 
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
 
Android Layout.pptx
Android Layout.pptxAndroid Layout.pptx
Android Layout.pptx
 
tic-tac-toe: Game playing
 tic-tac-toe: Game playing tic-tac-toe: Game playing
tic-tac-toe: Game playing
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Time and Space Complexity
Time and Space ComplexityTime and Space Complexity
Time and Space Complexity
 
The Joy of SciPy
The Joy of SciPyThe Joy of SciPy
The Joy of SciPy
 
Jeet ooad unit-2
Jeet ooad unit-2Jeet ooad unit-2
Jeet ooad unit-2
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
 
IoT Physical Devices and End Points.pdf
IoT Physical Devices and End Points.pdfIoT Physical Devices and End Points.pdf
IoT Physical Devices and End Points.pdf
 
07 approximate inference in bn
07 approximate inference in bn07 approximate inference in bn
07 approximate inference in bn
 

Viewers also liked

artificial intelligence
artificial intelligenceartificial intelligence
artificial intelligenceNirali Mayani
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Hirofumi Iwasaki
 
Building Cognitive Applications with Watson APIs
Building Cognitive Applications with Watson APIs Building Cognitive Applications with Watson APIs
Building Cognitive Applications with Watson APIs Dev_Events
 
EIA2016Nice - Landry Holi_How AI Can Shape the Future of Travel
EIA2016Nice - Landry Holi_How AI Can Shape the Future of TravelEIA2016Nice - Landry Holi_How AI Can Shape the Future of Travel
EIA2016Nice - Landry Holi_How AI Can Shape the Future of TravelEuropean Innovation Academy
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Reza Rahman
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsMurat Yener
 
Java EE 8 Recipes
Java EE 8 RecipesJava EE 8 Recipes
Java EE 8 RecipesJosh Juneau
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 updateDavid Delabassee
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJosh Juneau
 
Java EE 8: On the Horizon
Java EE 8:  On the HorizonJava EE 8:  On the Horizon
Java EE 8: On the HorizonJosh Juneau
 
Artificial Intelligence in Project Management by Dr. Khaled A. Hamdy
Artificial Intelligence in Project Management by  Dr. Khaled A. HamdyArtificial Intelligence in Project Management by  Dr. Khaled A. Hamdy
Artificial Intelligence in Project Management by Dr. Khaled A. HamdyAgile ME
 
Barreras afectivas
Barreras afectivas Barreras afectivas
Barreras afectivas Emagister
 
Java EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 MeanJava EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 MeanAlex Theedom
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchReza Rahman
 
10 Revealing Statistics About Compensation & Benefits You should Know
10 Revealing Statistics About Compensation & Benefits You should Know10 Revealing Statistics About Compensation & Benefits You should Know
10 Revealing Statistics About Compensation & Benefits You should KnowElodie A.
 
Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEReza Rahman
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 

Viewers also liked (20)

artificial intelligence
artificial intelligenceartificial intelligence
artificial intelligence
 
Integrity
IntegrityIntegrity
Integrity
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
 
Java EE Next
Java EE NextJava EE Next
Java EE Next
 
Building Cognitive Applications with Watson APIs
Building Cognitive Applications with Watson APIs Building Cognitive Applications with Watson APIs
Building Cognitive Applications with Watson APIs
 
EIA2016Nice - Landry Holi_How AI Can Shape the Future of Travel
EIA2016Nice - Landry Holi_How AI Can Shape the Future of TravelEIA2016Nice - Landry Holi_How AI Can Shape the Future of Travel
EIA2016Nice - Landry Holi_How AI Can Shape the Future of Travel
 
Deep Learning meetup
Deep Learning meetupDeep Learning meetup
Deep Learning meetup
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
 
Java EE 8 Recipes
Java EE 8 RecipesJava EE 8 Recipes
Java EE 8 Recipes
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 update
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 
Java EE 8: On the Horizon
Java EE 8:  On the HorizonJava EE 8:  On the Horizon
Java EE 8: On the Horizon
 
Artificial Intelligence in Project Management by Dr. Khaled A. Hamdy
Artificial Intelligence in Project Management by  Dr. Khaled A. HamdyArtificial Intelligence in Project Management by  Dr. Khaled A. Hamdy
Artificial Intelligence in Project Management by Dr. Khaled A. Hamdy
 
Barreras afectivas
Barreras afectivas Barreras afectivas
Barreras afectivas
 
Java EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 MeanJava EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 Mean
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great Match
 
10 Revealing Statistics About Compensation & Benefits You should Know
10 Revealing Statistics About Compensation & Benefits You should Know10 Revealing Statistics About Compensation & Benefits You should Know
10 Revealing Statistics About Compensation & Benefits You should Know
 
Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EE
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Similar to JAVA in Artificial intelligent

Android webinar class_java_review
Android webinar class_java_reviewAndroid webinar class_java_review
Android webinar class_java_reviewEdureka!
 
Introduction to java 101
Introduction to java 101Introduction to java 101
Introduction to java 101kankemwa Ishaku
 
Programming in java basics
Programming in java  basicsProgramming in java  basics
Programming in java basicsLovelitJose
 
Java class 1
Java class 1Java class 1
Java class 1Edureka!
 
Learn To Code: Introduction to java
Learn To Code: Introduction to javaLearn To Code: Introduction to java
Learn To Code: Introduction to javaSadhanaParameswaran
 
2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)Shoaib Ghachi
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)Thinkful
 
Technical trainning.pptx
Technical trainning.pptxTechnical trainning.pptx
Technical trainning.pptxSanuSan3
 
Thinkful - Intro to JavaScript
Thinkful - Intro to JavaScriptThinkful - Intro to JavaScript
Thinkful - Intro to JavaScriptTJ Stalcup
 
Java Basics for selenium
Java Basics for seleniumJava Basics for selenium
Java Basics for seleniumapoorvams
 
JavaScript, VBScript, AJAX, CGI
JavaScript, VBScript, AJAX, CGIJavaScript, VBScript, AJAX, CGI
JavaScript, VBScript, AJAX, CGIAashish Jain
 
Programming Language
Programming  LanguageProgramming  Language
Programming LanguageAdeel Hamid
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.Tarunsingh198
 
C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#Hawkman Academy
 

Similar to JAVA in Artificial intelligent (20)

Unit 1
Unit 1Unit 1
Unit 1
 
Android webinar class_java_review
Android webinar class_java_reviewAndroid webinar class_java_review
Android webinar class_java_review
 
Introduction to java 101
Introduction to java 101Introduction to java 101
Introduction to java 101
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Introduction to C ++.pptx
Introduction to C ++.pptxIntroduction to C ++.pptx
Introduction to C ++.pptx
 
Programming in java basics
Programming in java  basicsProgramming in java  basics
Programming in java basics
 
Java 101
Java 101Java 101
Java 101
 
Java class 1
Java class 1Java class 1
Java class 1
 
Learn To Code: Introduction to java
Learn To Code: Introduction to javaLearn To Code: Introduction to java
Learn To Code: Introduction to java
 
2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)
 
Java
Java Java
Java
 
Technical trainning.pptx
Technical trainning.pptxTechnical trainning.pptx
Technical trainning.pptx
 
Thinkful - Intro to JavaScript
Thinkful - Intro to JavaScriptThinkful - Intro to JavaScript
Thinkful - Intro to JavaScript
 
Java Basics for selenium
Java Basics for seleniumJava Basics for selenium
Java Basics for selenium
 
JavaScript, VBScript, AJAX, CGI
JavaScript, VBScript, AJAX, CGIJavaScript, VBScript, AJAX, CGI
JavaScript, VBScript, AJAX, CGI
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
 
C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#
 
Basic concept of c++
Basic concept of c++Basic concept of c++
Basic concept of c++
 

Recently uploaded

Modelling Guide for Timber Structures - FPInnovations
Modelling Guide for Timber Structures - FPInnovationsModelling Guide for Timber Structures - FPInnovations
Modelling Guide for Timber Structures - FPInnovationsYusuf Yıldız
 
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...Amil baba
 
cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabusViolet Violet
 
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS Bahzad5
 
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxUNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxrealme6igamerr
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchrohitcse52
 
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
Engineering Mechanics  Chapter 5  Equilibrium of a Rigid BodyEngineering Mechanics  Chapter 5  Equilibrium of a Rigid Body
Engineering Mechanics Chapter 5 Equilibrium of a Rigid BodyAhmadHajasad2
 
Gender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 ProjectGender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 Projectreemakb03
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesDIPIKA83
 
A Seminar on Electric Vehicle Software Simulation
A Seminar on Electric Vehicle Software SimulationA Seminar on Electric Vehicle Software Simulation
A Seminar on Electric Vehicle Software SimulationMohsinKhanA
 
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxLMW Machine Tool Division
 
Strategies of Urban Morphologyfor Improving Outdoor Thermal Comfort and Susta...
Strategies of Urban Morphologyfor Improving Outdoor Thermal Comfort and Susta...Strategies of Urban Morphologyfor Improving Outdoor Thermal Comfort and Susta...
Strategies of Urban Morphologyfor Improving Outdoor Thermal Comfort and Susta...amrabdallah9
 
Design Analysis of Alogorithm 1 ppt 2024.pptx
Design Analysis of Alogorithm 1 ppt 2024.pptxDesign Analysis of Alogorithm 1 ppt 2024.pptx
Design Analysis of Alogorithm 1 ppt 2024.pptxrajesshs31r
 
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Sean Meyn
 
cme397 surface engineering unit 5 part A questions and answers
cme397 surface engineering unit 5 part A questions and answerscme397 surface engineering unit 5 part A questions and answers
cme397 surface engineering unit 5 part A questions and answerskarthi keyan
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfodunowoeminence2019
 
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratoryدليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide LaboratoryBahzad5
 

Recently uploaded (20)

Modelling Guide for Timber Structures - FPInnovations
Modelling Guide for Timber Structures - FPInnovationsModelling Guide for Timber Structures - FPInnovations
Modelling Guide for Timber Structures - FPInnovations
 
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
 
cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabus
 
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
 
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxUNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
 
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
Engineering Mechanics  Chapter 5  Equilibrium of a Rigid BodyEngineering Mechanics  Chapter 5  Equilibrium of a Rigid Body
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
 
Présentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdfPrésentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdf
 
Gender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 ProjectGender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 Project
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display Devices
 
Lecture 2 .pdf
Lecture 2                           .pdfLecture 2                           .pdf
Lecture 2 .pdf
 
A Seminar on Electric Vehicle Software Simulation
A Seminar on Electric Vehicle Software SimulationA Seminar on Electric Vehicle Software Simulation
A Seminar on Electric Vehicle Software Simulation
 
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
 
Strategies of Urban Morphologyfor Improving Outdoor Thermal Comfort and Susta...
Strategies of Urban Morphologyfor Improving Outdoor Thermal Comfort and Susta...Strategies of Urban Morphologyfor Improving Outdoor Thermal Comfort and Susta...
Strategies of Urban Morphologyfor Improving Outdoor Thermal Comfort and Susta...
 
Design Analysis of Alogorithm 1 ppt 2024.pptx
Design Analysis of Alogorithm 1 ppt 2024.pptxDesign Analysis of Alogorithm 1 ppt 2024.pptx
Design Analysis of Alogorithm 1 ppt 2024.pptx
 
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
 
cme397 surface engineering unit 5 part A questions and answers
cme397 surface engineering unit 5 part A questions and answerscme397 surface engineering unit 5 part A questions and answers
cme397 surface engineering unit 5 part A questions and answers
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
 
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratoryدليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
 

JAVA in Artificial intelligent

  • 1. AI Programming with JAVA By:Virat Andodariya M.S.University 1
  • 2. How Artificial Intelligence Programmed? Java Basics Graph coloring Problem Uniform Cost Search Contents 2
  • 3. How Artificial Intelligence Programmed? C++ C# Java Lisp Python 3
  • 4. Java Basics • The Java Virtual Machine • Applications & Applets • Classes & Objects • Start up Java • Variables & Assignments • Strings & Characters • Arithmetic Operators & Expressions • Comments • Keywords • Creating and Compiling Programs • Modifiers 4
  • 5. Bytecodes and the Java Virtual Machine 5
  • 6. Java Program • Java Application Program – Application • Program written in general programming language – Applet • Program running in Web Browser Environment • Can be viewed by appletviewer or Web browser with JVM 6
  • 7. Classes and Objects • Object – Memory Space to Define State and Operation – Instance of Class • Class – A class is a template or blueprint for objects. To program in Java, you must understand classes and be able to write and use them. – Template of Creating Object 7
  • 8. The Java Class Libraries • java.applet : Applet related • java.awt : Abstract Window Toolkit • java.awt.event : Event process from awt component • java.awt.image : Image processing • java.beans : JavaBeans Component • java.io : File or Network I/O Support • java.lang : Java Language Support • java.net : Network related functions • java.util : Utility function 8
  • 9. Start a Java Application 9
  • 10. Variables and Assignments • Types – char 16bits Unicode character data – boolean Boolean Variable – byte 8 bits signed integer – short 16 bits signed integer – int 32 bits signed integer – long 64 bits signed integer – float 32 bits signed floating point number – double 64 bits signed floating point number 10
  • 11. Variables and Assignments • String : sequence of character String s = “Enter an integer value: ” ; • Concatenation Operator ‘+’ String s = “Lincoln said: ” + “” Four score and seven years ago”” ; Result : Lincoln said: “Four score and seven years ago” 11
  • 12. Comments • Single Line Comment – int i = 10 ; // i is counter • Multiple Line Comment /* Some comments */ • Documentation Comment /** Documentation Comment */ 12
  • 13. Java Keywords • 50 Java Keywords abstract double int super boolean else interface s witch break extends long synchronized byte final native this case finally new throw catch float package throws char for private transient* class goto* protected try const* if public void continue implements return volatile default import short while do instanceof static strictfp assert (New in 1.5) enum (New in 1.5) 13
  • 14. Control Statement • A statement represents an action or a sequence of actions. To change the execution order of program • As the method of controlling the execution order – Conditional Statement : if St., switch St. – Repeat Statement : for St., while St., do-while St. – Branch Statement : break St., continue St., return St. 14
  • 15. For Statement  Repeat the sequence of statement as many as defined.  Form of for statement for ( <expr. 1> ; < expr. 2> ; < expr. 3>) <statement>  <expr. 1> : initialize the control variable  <expr. 2> : check the control variable  <expr. 3> : modify the control variable s = 0; for (i=1; i<=N; ++i) // sum from 1 to N : i increment s += i; 15
  • 16. Break Statement • To move control to the out of the block • From of break statement break [label] ; 16
  • 17. Source Code Create/Modify Source Code Compile Source Code i.e. javac Welcome.java Bytecode Run Byteode i.e. java Welcome Result If compilation errors If runtime errors or incorrect result 17
  • 18. Modifiers Java uses certain reserved words called modifiers that specify the properties of the data, methods, and classes and how they can be used. Examples of modifiers are public and static. Other modifiers are private, final, abstract, and protected. A public datum, method, or class can be accessed by other programs. A private datum or method cannot be accessed by other programs. 18
  • 21. 21
  • 22. 22
  • 23. 23
  • 24. 24
  • 27. 27
  • 28. 28
  • 29. 29
  • 30. 30
  • 31. 31
  • 32. 32
  • 33. 33
  • 34. 34
  • 35. 35
  • 36. 36
  • 37. 37
  • 38. 38
  • 39. References • Java™ 2:The Complete Reference,Fifth Edition Herbert Schildt • JDK Developer Kit • JGRASP (CSD) Compiler 39