SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Chapter 2:  Objects and Primitive Data  Presentation slides for Java Software Solutions for AP* Computer Science by John Lewis, William Loftus, and Cara Cocking Java Software Solutions is published by Addison-Wesley Presentation slides are copyright 2002 by John Lewis, William Loftus, and Cara Cocking. All rights reserved. Instructors using the textbook may use and modify these slides for pedagogical purposes. *AP is a registered trademark of The College Entrance Examination Board which was not involved in the production of, and does not endorse, this product.
Objects and Primitive Data ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction to Objects ,[object Object],[object Object],[object Object],[object Object],[object Object]
Objects and Classes Bank   Account A class (the concept) John’s Bank Account Balance: $5,257 An object (the realization) Bill’s Bank Account Balance: $1,245,069 Mary’s Bank Account Balance: $16,833 Multiple objects from the same class
Inheritance ,[object Object],[object Object],Bank   Account Account Charge   Account Savings   Account Checking   Account
Using Objects ,[object Object],[object Object],System.out.println ("Whatever you are, be a good one."); object method information provided to the method (parameters)
The print Method ,[object Object],[object Object],[object Object],[object Object]
Abstraction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Character Strings ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
String Concatenation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Escape Sequences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Escape Sequences ,[object Object],[object Object],Escape Sequence     amp;quot; apos;  Meaning backspace tab newline carriage return double quote single quote backslash
Variables ,[object Object],[object Object],int total; int count, temp, result; Multiple variables can be created in one declaration data type variable name
Variables ,[object Object],[object Object],[object Object],int sum = 0; int base = 32, max = 149;
Assignment ,[object Object],[object Object],total = 55; ,[object Object],[object Object],[object Object],[object Object]
Constants ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Primitive Data ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Numeric Primitive Data ,[object Object],[object Object],Type int double Storage 32 bits 64 bits Min Value -2,147,483,648 +/- 1.7 x 10 308  with 15 significant digits Max Value 2,147,483,647
Boolean ,[object Object],[object Object],[object Object],[object Object]
Characters ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Characters ,[object Object],[object Object],uppercase letters lowercase letters punctuation digits special symbols control characters A, B, C, … a, b, c, … period, semi-colon, … 0, 1, 2, … &, |,  … carriage return, tab, ...
Arithmetic Expressions ,[object Object],[object Object],Addition + Subtraction - Multiplication * Division / Remainder % ,[object Object]
Division and Remainder ,[object Object],[object Object],14 / 3   equals? 8 / 12   equals? 4 0 14 % 3   equals? 8 % 12   equals? 2 8
Operator Precedence ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Operator Precedence ,[object Object],a + b + c + d + e 1 4 3 2 a + b * c - d / e 3 2 4 1 a / (b + c) - d % e 2 3 4 1 a / (b * (c + (d - e))) 4 1 2 3
Assignment Revisited ,[object Object],First the expression on the right hand side of the = operator is evaluated Then the result is stored in the variable on the left hand side answer  =  sum / 4 + MAX * lowest; 1 4 3 2
Assignment Revisited ,[object Object],First, one is added to the original value of count Then the result is stored back into count (overwriting the original value) count  =  count + 1;
Data Conversions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Data Conversions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data Conversions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Creating Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Creating Objects ,[object Object],title = new String ("Java Software Solutions"); This calls the String  constructor , which is a special method that sets up the object ,[object Object],[object Object]
Creating Objects ,[object Object],[object Object],[object Object],[object Object],[object Object]
String Methods ,[object Object],[object Object],[object Object],[object Object]
Wrapper Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Class Libraries ,[object Object],[object Object],[object Object],[object Object],[object Object]
Packages ,[object Object],[object Object],Package java.lang java.applet java.awt javax.swing java.net java.util javax.xml.parsers Purpose General support Creating applets for the web Graphics and graphical user interfaces Additional graphics capabilities and components Network communication Utilities XML document processing
The import Declaration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The import Declaration ,[object Object],[object Object],[object Object],[object Object],[object Object]
Class Methods ,[object Object],[object Object],[object Object],[object Object]
The Keyboard Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Formatting Output ,[object Object],[object Object],[object Object],[object Object],[object Object]
Formatting Output ,[object Object],[object Object],[object Object],[object Object]
Applets ,[object Object],[object Object],[object Object],[object Object],[object Object]
Applets ,[object Object],[object Object],[object Object],[object Object]
Applets ,[object Object],[object Object],[object Object],[object Object],[object Object]
The HTML applet Tag <html> <head> <title>The Einstein Applet</title> </head> <body> <applet code=&quot;Einstein.class&quot; width=350 height=175> </applet> </body> </html>
Drawing Shapes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Drawing a Line 10 20 150 45 X Y page.drawLine (10, 20, 150, 45); page.drawLine (150, 45, 10, 20); or
Drawing a Rectangle page.drawRect (50, 20, 100, 40); 50 20 X Y 100 40
Drawing an Oval page.drawOval (175, 20, 50, 80); 175 20 bounding rectangle X Y 50 80
The Color Class ,[object Object],[object Object],Object Color.black Color.blue Color.cyan Color.orange Color.white Color.yellow RGB Value 0, 0, 0 0, 0, 255 0, 255, 255 255, 200, 0 255, 255, 255 255, 255, 0
The Color Class ,[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and OperatorsMarwa Ali Eissa
 
Effective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All ObjectsEffective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All Objectsİbrahim Kürce
 
Fundamental programming structures in java
Fundamental programming structures in javaFundamental programming structures in java
Fundamental programming structures in javaShashwat Shriparv
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++K Durga Prasad
 
Effective Java - Methods Common to All Objects
Effective Java - Methods Common to All ObjectsEffective Java - Methods Common to All Objects
Effective Java - Methods Common to All ObjectsRoshan Deniyage
 
Lesson 02 python keywords and identifiers
Lesson 02   python keywords and identifiersLesson 02   python keywords and identifiers
Lesson 02 python keywords and identifiersNilimesh Halder
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Examshishamrizvi
 
presentation of java fundamental
presentation of java fundamentalpresentation of java fundamental
presentation of java fundamentalGanesh Chittalwar
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2Prerna Sharma
 
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya UdagedaraLambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya UdagedaraJaliya Udagedara
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of CSuchit Patel
 
C# language basics (Visual studio)
C# language basics (Visual studio)C# language basics (Visual studio)
C# language basics (Visual studio)rnkhan
 

Was ist angesagt? (19)

Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
 
M C6java3
M C6java3M C6java3
M C6java3
 
Basic
BasicBasic
Basic
 
Effective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All ObjectsEffective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All Objects
 
Fundamental programming structures in java
Fundamental programming structures in javaFundamental programming structures in java
Fundamental programming structures in java
 
M C6java2
M C6java2M C6java2
M C6java2
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Effective Java - Methods Common to All Objects
Effective Java - Methods Common to All ObjectsEffective Java - Methods Common to All Objects
Effective Java - Methods Common to All Objects
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Ch02
Ch02Ch02
Ch02
 
Lesson 02 python keywords and identifiers
Lesson 02   python keywords and identifiersLesson 02   python keywords and identifiers
Lesson 02 python keywords and identifiers
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
presentation of java fundamental
presentation of java fundamentalpresentation of java fundamental
presentation of java fundamental
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2
 
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya UdagedaraLambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
 
Ch06
Ch06Ch06
Ch06
 
Ch08
Ch08Ch08
Ch08
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
 
C# language basics (Visual studio)
C# language basics (Visual studio)C# language basics (Visual studio)
C# language basics (Visual studio)
 

Andere mochten auch

Ap Power Point Chpt9
Ap Power Point Chpt9Ap Power Point Chpt9
Ap Power Point Chpt9dplunkett
 
First Principles Of Cs Instruction
First Principles Of Cs InstructionFirst Principles Of Cs Instruction
First Principles Of Cs InstructionKatrin Becker
 
Ap Power Point Chpt1
Ap Power Point Chpt1Ap Power Point Chpt1
Ap Power Point Chpt1dplunkett
 
Internet principles of operation
Internet principles of operationInternet principles of operation
Internet principles of operationInqilab Patel
 

Andere mochten auch (7)

JavaYDL20
JavaYDL20JavaYDL20
JavaYDL20
 
Ap Power Point Chpt9
Ap Power Point Chpt9Ap Power Point Chpt9
Ap Power Point Chpt9
 
First Principles Of Cs Instruction
First Principles Of Cs InstructionFirst Principles Of Cs Instruction
First Principles Of Cs Instruction
 
Lecture 4 recursion
Lecture 4    recursionLecture 4    recursion
Lecture 4 recursion
 
Recursion Lecture in Java
Recursion Lecture in JavaRecursion Lecture in Java
Recursion Lecture in Java
 
Ap Power Point Chpt1
Ap Power Point Chpt1Ap Power Point Chpt1
Ap Power Point Chpt1
 
Internet principles of operation
Internet principles of operationInternet principles of operation
Internet principles of operation
 

Ähnlich wie Chapter 2 Objects Primitive Data

Oop with c++ notes unit 01 introduction
Oop with c++ notes   unit 01 introductionOop with c++ notes   unit 01 introduction
Oop with c++ notes unit 01 introductionAnanda Kumar HN
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data TypesTareq Hasan
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++Aahwini Esware gowda
 
Programming presentation
Programming presentationProgramming presentation
Programming presentationFiaz Khokhar
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
component of c language.pptx
component of c language.pptxcomponent of c language.pptx
component of c language.pptxAnisZahirahAzman
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c languageAkshhayPatel
 
Java căn bản - Chapter3
Java căn bản - Chapter3Java căn bản - Chapter3
Java căn bản - Chapter3Vince Vo
 
TOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfTOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfEjazAlam23
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic Manzoor ALam
 
C++ PROGRAMMING BASICS
C++ PROGRAMMING BASICSC++ PROGRAMMING BASICS
C++ PROGRAMMING BASICSAami Kakakhel
 

Ähnlich wie Chapter 2 Objects Primitive Data (20)

C program
C programC program
C program
 
Oop with c++ notes unit 01 introduction
Oop with c++ notes   unit 01 introductionOop with c++ notes   unit 01 introduction
Oop with c++ notes unit 01 introduction
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
C++.pptx
C++.pptxC++.pptx
C++.pptx
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
C++ lecture 01
C++   lecture 01C++   lecture 01
C++ lecture 01
 
component of c language.pptx
component of c language.pptxcomponent of c language.pptx
component of c language.pptx
 
C++ programming
C++ programmingC++ programming
C++ programming
 
1 Revision Tour
1 Revision Tour1 Revision Tour
1 Revision Tour
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c language
 
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
 
Java căn bản - Chapter3
Java căn bản - Chapter3Java căn bản - Chapter3
Java căn bản - Chapter3
 
Python
PythonPython
Python
 
TOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfTOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdf
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
C++ PROGRAMMING BASICS
C++ PROGRAMMING BASICSC++ PROGRAMMING BASICS
C++ PROGRAMMING BASICS
 

Kürzlich hochgeladen

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Kürzlich hochgeladen (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

Chapter 2 Objects Primitive Data

  • 1. Chapter 2: Objects and Primitive Data Presentation slides for Java Software Solutions for AP* Computer Science by John Lewis, William Loftus, and Cara Cocking Java Software Solutions is published by Addison-Wesley Presentation slides are copyright 2002 by John Lewis, William Loftus, and Cara Cocking. All rights reserved. Instructors using the textbook may use and modify these slides for pedagogical purposes. *AP is a registered trademark of The College Entrance Examination Board which was not involved in the production of, and does not endorse, this product.
  • 2.
  • 3.
  • 4. Objects and Classes Bank Account A class (the concept) John’s Bank Account Balance: $5,257 An object (the realization) Bill’s Bank Account Balance: $1,245,069 Mary’s Bank Account Balance: $16,833 Multiple objects from the same class
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47. The HTML applet Tag <html> <head> <title>The Einstein Applet</title> </head> <body> <applet code=&quot;Einstein.class&quot; width=350 height=175> </applet> </body> </html>
  • 48.
  • 49. Drawing a Line 10 20 150 45 X Y page.drawLine (10, 20, 150, 45); page.drawLine (150, 45, 10, 20); or
  • 50. Drawing a Rectangle page.drawRect (50, 20, 100, 40); 50 20 X Y 100 40
  • 51. Drawing an Oval page.drawOval (175, 20, 50, 80); 175 20 bounding rectangle X Y 50 80
  • 52.
  • 53.
  • 54.