SlideShare une entreprise Scribd logo
1  sur  107
Introduction to Computer Science II COSC 1320/6305 Lecture  4:  Defining Classes II (Chapter 5)
5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
5.1  Static Methods  and  Static Variables 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
From  Fahrenheit  to  Celsius   Java Program ,[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved. CLASS Participation A! (pp. 260)
Static Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Pitfall:  Invoking a  Nonstatic Method  Within a  Static Method ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Tip:  You Can Put a  main  in any  Class ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Another Class with a  main  Added  (Part 1 of 4) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Another Class with a  main  Added  (Part 2 of 4) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Another Class with a  main  Added  (Part 3 of 4) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Another Class with a  main  Added  (Part 4 of 4) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Temperature.java 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Invocation Counter Java Program ,[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved. CLASS Participation B! (pp. 264)
Static Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Static Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
InvocationCounter.java 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Static Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
The  Math  Class ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Some Methods in the Class  Math   (Part 1 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Some Methods in the Class  Math   (Part 2 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Some Methods in the Class  Math   (Part 3 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Some Methods in the Class  Math   (Part 4 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Some Methods in the Class  Math   (Part 5 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Random Numbers ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved. public  static  double random() double num =  Math . random() ;
Wrapper Classes ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Wrapper Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Wrapper Classes ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Automatic Boxing and Unboxing ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Constants and Static Methods in  Wrapper Classes ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Constants and  Static Methods  in  Wrapper Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
String Processor Java Program ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved. CLASS Participation C! (pp. 277)
Some Methods in the  Class   Character  (Part 1 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Some Methods in the Class  Character  (Part 2 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Some Methods in the Class  Character  (Part 3 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
5.2  References  and  Class Parameters 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Toy Class References Java Program ,[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved. CLASS Participation D! (pp. 281)
ToyClass.java 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Variables   and  Memory ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Variables  and  Memory ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Variables  and  Memory ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
References ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
References ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
References ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Class Type Variables Store a  Reference  (Part 1 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Class Type Variables Store a  Reference  (Part 2 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Assignment Operator with Class Type Variables (Part 1 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Assignment Operator with Class Type Variables (Part 2 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Assignment Operator with Class Type Variables (Part 3 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Class  Parameters ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Class  Parameters 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Class  Parameters 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Class  Parameters ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Parameters of a  Class  Type 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Memory Picture for Display 5.14  (Part 1 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Memory Picture for Display 5.14  (Part 2 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Memory Picture for Display 5.14  (Part 3 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Differences Between Primitive &  Class  Type Parameters ,[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Comparing Parameters of a  Class  Type and a Primitive Type (Part 1 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Comparing Parameters of a  Class  Type and a Primitive Type (Part 2 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
A Toy Class to Use in Display 5.16  (Part 1 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
A Toy Class to Use in Display 5.16  (Part 2 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Pitfall:  Use of  =  and  ==  with Variables of a  Class  Type ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
The Constant  null ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Pitfall:  null  Pointer Exception ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
The  new  Operator and  Anonymous   Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Another Approach to  Keyboard  Input Using  Double.parseDouble  (Part 1 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Another Approach to Keyboard Input Using  Double . parseDouble   (Part 2 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Another Approach to Keyboard Input Using  Double.parseDouble  (Part 3 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
5.3  Using  and  Misusing  References 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Using  and  Misusing  References ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Designing A  Person  Class:  Instance Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Designing a  Person  Class:  Constructor ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
A  Person   Class  Constructor ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Designing a  Person   Class :  the Class Invariant ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Designing a  Person  Class:  the Class Invariant ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Designing a  Person  Class:  the  equals   and  datesMatch  Methods ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Designing a  Person  Class:  the  equals  Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Designing a  Person  Class:  the  matchDate  Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Designing a  Person  Class:  the  toString  Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Copy  Constructors ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Copy Constructor  for a Class with  Primitive Type Instance Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Copy Constructor  for a Class with  Class  Type Instance Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Copy Constructor for a Class with  Class   Type Instance Variables ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Copy Constructor  for a  Class  with  Class   Type Instance Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Pitfall:  Privacy Leaks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Mutable  and  Immutable  Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Mutable and Immutable Classes ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Mutable  and Immutable  Classes ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Deep Copy Versus Shallow Copy ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
5.4  Packages  and  javadoc 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Packages  and  import  Statements ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
import  Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
The  package  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
The Package  java.lang ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Package Names and Directories ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
A Package Name 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Pitfall:  Subdirectories  Are Not Automatically Imported ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
The  Default Package ,[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Pitfall:  Not Including the Current Directory in Your Class Path ,[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Specifying a Class Path When You Compile ,[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Name  Clashes ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Introduction to  javadoc ,[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Commenting Classes for  javadoc ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Commenting Classes for  javadoc ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
@ Tags ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Running  javadoc ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Options for  javadoc 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

Contenu connexe

Tendances

Eo gaddis java_chapter_06_Classes and Objects
Eo gaddis java_chapter_06_Classes and ObjectsEo gaddis java_chapter_06_Classes and Objects
Eo gaddis java_chapter_06_Classes and ObjectsGina Bullock
 
Wrapper class (130240116056)
Wrapper class (130240116056)Wrapper class (130240116056)
Wrapper class (130240116056)Akshay soni
 
String handling(string buffer class)
String handling(string buffer class)String handling(string buffer class)
String handling(string buffer class)Ravi Kant Sahu
 
L9 wrapper classes
L9 wrapper classesL9 wrapper classes
L9 wrapper classesteach4uin
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4dplunkett
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVAAnkita Totala
 
Chapter 8.3
Chapter 8.3Chapter 8.3
Chapter 8.3sotlsoc
 
Eo gaddis java_chapter_09_5e
Eo gaddis java_chapter_09_5eEo gaddis java_chapter_09_5e
Eo gaddis java_chapter_09_5eGina Bullock
 
Farhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd YearFarhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd Yeardezyneecole
 

Tendances (17)

Eo gaddis java_chapter_06_Classes and Objects
Eo gaddis java_chapter_06_Classes and ObjectsEo gaddis java_chapter_06_Classes and Objects
Eo gaddis java_chapter_06_Classes and Objects
 
Md03 - part3
Md03 - part3Md03 - part3
Md03 - part3
 
Generics
GenericsGenerics
Generics
 
Keywords and classes
Keywords and classesKeywords and classes
Keywords and classes
 
wrapper classes
wrapper classeswrapper classes
wrapper classes
 
Wrapper class (130240116056)
Wrapper class (130240116056)Wrapper class (130240116056)
Wrapper class (130240116056)
 
Java tutorial part 3
Java tutorial part 3Java tutorial part 3
Java tutorial part 3
 
String handling(string buffer class)
String handling(string buffer class)String handling(string buffer class)
String handling(string buffer class)
 
L9 wrapper classes
L9 wrapper classesL9 wrapper classes
L9 wrapper classes
 
Java Generics
Java GenericsJava Generics
Java Generics
 
Generics in java
Generics in javaGenerics in java
Generics in java
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
 
Java -lec-6
Java -lec-6Java -lec-6
Java -lec-6
 
Chapter 8.3
Chapter 8.3Chapter 8.3
Chapter 8.3
 
Eo gaddis java_chapter_09_5e
Eo gaddis java_chapter_09_5eEo gaddis java_chapter_09_5e
Eo gaddis java_chapter_09_5e
 
Farhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd YearFarhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd Year
 

En vedette

Learn Database Design with MySQL - Chapter 3 - My sql storage engines
Learn Database Design with MySQL - Chapter 3 - My sql storage enginesLearn Database Design with MySQL - Chapter 3 - My sql storage engines
Learn Database Design with MySQL - Chapter 3 - My sql storage enginesEduonix Learning Solutions
 
Learn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesLearn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesEduonix Learning Solutions
 
Lecture 5 inheritance
Lecture 5 inheritanceLecture 5 inheritance
Lecture 5 inheritancethe_wumberlog
 
Learn Database Design with MySQL - Chapter 2 - My sql overview
Learn Database Design with MySQL - Chapter 2 - My sql overviewLearn Database Design with MySQL - Chapter 2 - My sql overview
Learn Database Design with MySQL - Chapter 2 - My sql overviewEduonix Learning Solutions
 
Lecture 6 polymorphism
Lecture 6 polymorphismLecture 6 polymorphism
Lecture 6 polymorphismthe_wumberlog
 
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationLearn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationEduonix Learning Solutions
 
Lecture 3 java basics
Lecture 3 java basicsLecture 3 java basics
Lecture 3 java basicsthe_wumberlog
 
Learn Database Design with MySQL - Chapter 6 - Database design process
Learn Database Design with MySQL - Chapter 6 - Database design processLearn Database Design with MySQL - Chapter 6 - Database design process
Learn Database Design with MySQL - Chapter 6 - Database design processEduonix Learning Solutions
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementationthe_wumberlog
 
Learn Database Design with MySQL - Chapter 1 - What is a database
Learn Database Design with MySQL - Chapter 1 -   What is a databaseLearn Database Design with MySQL - Chapter 1 -   What is a database
Learn Database Design with MySQL - Chapter 1 - What is a databaseEduonix Learning Solutions
 
Core java concepts
Core java  conceptsCore java  concepts
Core java conceptsRam132
 

En vedette (20)

Learn Database Design with MySQL - Chapter 3 - My sql storage engines
Learn Database Design with MySQL - Chapter 3 - My sql storage enginesLearn Database Design with MySQL - Chapter 3 - My sql storage engines
Learn Database Design with MySQL - Chapter 3 - My sql storage engines
 
Learn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesLearn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data types
 
Lecture 2 classes i
Lecture 2 classes iLecture 2 classes i
Lecture 2 classes i
 
Learn software development
Learn software developmentLearn software development
Learn software development
 
Learn hadoop and big data technologies
Learn hadoop and big data technologiesLearn hadoop and big data technologies
Learn hadoop and big data technologies
 
Ultimate android app development course
Ultimate android app development course Ultimate android app development course
Ultimate android app development course
 
Lecture 5 inheritance
Lecture 5 inheritanceLecture 5 inheritance
Lecture 5 inheritance
 
Learn node.js by building projects
Learn node.js by building projectsLearn node.js by building projects
Learn node.js by building projects
 
Learn Database Design with MySQL - Chapter 2 - My sql overview
Learn Database Design with MySQL - Chapter 2 - My sql overviewLearn Database Design with MySQL - Chapter 2 - My sql overview
Learn Database Design with MySQL - Chapter 2 - My sql overview
 
Lecture 6 polymorphism
Lecture 6 polymorphismLecture 6 polymorphism
Lecture 6 polymorphism
 
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationLearn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
 
Lecture 3 java basics
Lecture 3 java basicsLecture 3 java basics
Lecture 3 java basics
 
Learn Database Design with MySQL - Chapter 6 - Database design process
Learn Database Design with MySQL - Chapter 6 - Database design processLearn Database Design with MySQL - Chapter 6 - Database design process
Learn Database Design with MySQL - Chapter 6 - Database design process
 
Learn angularjs step by step
Learn angularjs step by stepLearn angularjs step by step
Learn angularjs step by step
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
 
Learn Database Design with MySQL - Chapter 1 - What is a database
Learn Database Design with MySQL - Chapter 1 -   What is a databaseLearn Database Design with MySQL - Chapter 1 -   What is a database
Learn Database Design with MySQL - Chapter 1 - What is a database
 
Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674
 
Java programming course for beginners
Java programming course for beginnersJava programming course for beginners
Java programming course for beginners
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
 

Similaire à Lecture 4 classes ii

Eo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5eEo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5eGina Bullock
 
Eo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5eEo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5eGina Bullock
 
Chapter 4 Absolute Java
Chapter 4 Absolute Java Chapter 4 Absolute Java
Chapter 4 Absolute Java Shariq Alee
 
OCA Java SE 8 Exam Chapter 4 Methods Encapsulation
OCA Java SE 8 Exam Chapter 4 Methods EncapsulationOCA Java SE 8 Exam Chapter 4 Methods Encapsulation
OCA Java SE 8 Exam Chapter 4 Methods Encapsulationİbrahim Kürce
 
Cso gaddis java_chapter6
Cso gaddis java_chapter6Cso gaddis java_chapter6
Cso gaddis java_chapter6RhettB
 
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docxPSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docxamrit47
 
4. java intro class
4. java intro class4. java intro class
4. java intro classQuan Ho
 
Java As an OOP Language,Exception Handling & Applets
Java As an OOP Language,Exception Handling & AppletsJava As an OOP Language,Exception Handling & Applets
Java As an OOP Language,Exception Handling & AppletsHelen SagayaRaj
 
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...Sagar Verma
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocksİbrahim Kürce
 
UNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
UNIT-2.pptx CS3391 Inheritance , types, packages and InterfacesUNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
UNIT-2.pptx CS3391 Inheritance , types, packages and InterfacesSakkaravarthiS1
 
Eo gaddis java_chapter_03_5e
Eo gaddis java_chapter_03_5eEo gaddis java_chapter_03_5e
Eo gaddis java_chapter_03_5eGina Bullock
 

Similaire à Lecture 4 classes ii (20)

Eo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5eEo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5e
 
Eo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5eEo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5e
 
Hemajava
HemajavaHemajava
Hemajava
 
This and Static Keyword
This and Static KeywordThis and Static Keyword
This and Static Keyword
 
Chapter 4 Absolute Java
Chapter 4 Absolute Java Chapter 4 Absolute Java
Chapter 4 Absolute Java
 
OCA Java SE 8 Exam Chapter 4 Methods Encapsulation
OCA Java SE 8 Exam Chapter 4 Methods EncapsulationOCA Java SE 8 Exam Chapter 4 Methods Encapsulation
OCA Java SE 8 Exam Chapter 4 Methods Encapsulation
 
Java defining classes
Java defining classes Java defining classes
Java defining classes
 
Cso gaddis java_chapter6
Cso gaddis java_chapter6Cso gaddis java_chapter6
Cso gaddis java_chapter6
 
Lecture 6.pptx
Lecture 6.pptxLecture 6.pptx
Lecture 6.pptx
 
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docxPSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
 
4. java intro class
4. java intro class4. java intro class
4. java intro class
 
Java As an OOP Language,Exception Handling & Applets
Java As an OOP Language,Exception Handling & AppletsJava As an OOP Language,Exception Handling & Applets
Java As an OOP Language,Exception Handling & Applets
 
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
 
Classes2
Classes2Classes2
Classes2
 
Java basics
Java basicsJava basics
Java basics
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
 
Lecture 5.pptx
Lecture 5.pptxLecture 5.pptx
Lecture 5.pptx
 
UNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
UNIT-2.pptx CS3391 Inheritance , types, packages and InterfacesUNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
UNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
 
Eo gaddis java_chapter_03_5e
Eo gaddis java_chapter_03_5eEo gaddis java_chapter_03_5e
Eo gaddis java_chapter_03_5e
 
Lecture Notes
Lecture NotesLecture Notes
Lecture Notes
 

Lecture 4 classes ii

  • 1. Introduction to Computer Science II COSC 1320/6305 Lecture 4: Defining Classes II (Chapter 5)
  • 2. 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 3. 5.1 Static Methods and Static Variables 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Another Class with a main Added (Part 1 of 4) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 9. Another Class with a main Added (Part 2 of 4) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 10. Another Class with a main Added (Part 3 of 4) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 11. Another Class with a main Added (Part 4 of 4) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 12. Temperature.java 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 13.
  • 14.
  • 15.
  • 16. InvocationCounter.java 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 17.
  • 18.
  • 19. Some Methods in the Class Math (Part 1 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 20. Some Methods in the Class Math (Part 2 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 21. Some Methods in the Class Math (Part 3 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 22. Some Methods in the Class Math (Part 4 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 23. Some Methods in the Class Math (Part 5 of 5) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. Some Methods in the Class Character (Part 1 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 33. Some Methods in the Class Character (Part 2 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 34. Some Methods in the Class Character (Part 3 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 35. 5.2 References and Class Parameters 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 36.
  • 37. ToyClass.java 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44. Class Type Variables Store a Reference (Part 1 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 45. Class Type Variables Store a Reference (Part 2 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 46. Assignment Operator with Class Type Variables (Part 1 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 47. Assignment Operator with Class Type Variables (Part 2 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 48. Assignment Operator with Class Type Variables (Part 3 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 49.
  • 50. Class Parameters 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 51. Class Parameters 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 52.
  • 53. Parameters of a Class Type 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 54. Memory Picture for Display 5.14 (Part 1 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 55. Memory Picture for Display 5.14 (Part 2 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 56. Memory Picture for Display 5.14 (Part 3 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 57.
  • 58. Comparing Parameters of a Class Type and a Primitive Type (Part 1 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 59. Comparing Parameters of a Class Type and a Primitive Type (Part 2 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 60. A Toy Class to Use in Display 5.16 (Part 1 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 61. A Toy Class to Use in Display 5.16 (Part 2 of 2) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66. Another Approach to Keyboard Input Using Double.parseDouble (Part 1 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 67. Another Approach to Keyboard Input Using Double . parseDouble (Part 2 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 68. Another Approach to Keyboard Input Using Double.parseDouble (Part 3 of 3) 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 69. 5.3 Using and Misusing References 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90. 5.4 Packages and javadoc 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96. A Package Name 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107. Options for javadoc 5- Copyright © 2010 Pearson Addison-Wesley. All rights reserved.