SlideShare une entreprise Scribd logo
1  sur  40
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

Contenu connexe

Tendances (7)

Springer link 이용매뉴얼
Springer link 이용매뉴얼Springer link 이용매뉴얼
Springer link 이용매뉴얼
 
Gatling Performance Workshop
Gatling Performance WorkshopGatling Performance Workshop
Gatling Performance Workshop
 
Mind Reading Device
Mind Reading DeviceMind Reading Device
Mind Reading Device
 
i-Mouse
i-Mousei-Mouse
i-Mouse
 
Blue Brain Seminar Report
Blue Brain Seminar ReportBlue Brain Seminar Report
Blue Brain Seminar Report
 
Cuadernillo entrada1 matematica_5to_grado
Cuadernillo entrada1 matematica_5to_gradoCuadernillo entrada1 matematica_5to_grado
Cuadernillo entrada1 matematica_5to_grado
 
Touchless Touchscreen Technology
Touchless Touchscreen TechnologyTouchless Touchscreen Technology
Touchless Touchscreen Technology
 

En vedette

artificial intelligence
artificial intelligenceartificial intelligence
artificial intelligence
Nirali Mayani
 

En vedette (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
 

Similaire à JAVA in Artificial intelligent

Android webinar class_java_review
Android webinar class_java_reviewAndroid webinar class_java_review
Android webinar class_java_review
Edureka!
 
Java class 1
Java class 1Java class 1
Java class 1
Edureka!
 
Java developer trainee implementation and import
Java developer trainee implementation and importJava developer trainee implementation and import
Java developer trainee implementation and import
iamluqman0403
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)
Thinkful
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
Adeel Hamid
 

Similaire à 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#)
 
JavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdfJavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdf
 
Java developer trainee implementation and import
Java developer trainee implementation and importJava developer trainee implementation and import
Java developer trainee implementation and import
 
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.
 

Dernier

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 

Dernier (20)

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 

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