Презентация Lesson 5. Working with Objects онлайн

На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему Lesson 5. Working with Objects абсолютно бесплатно. Урок-презентация на эту тему содержит всего 45 слайдов. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.



Оцените!
Оцените презентацию от 1 до 5 баллов!
  • Тип файла:
    ppt / pptx (powerpoint)
  • Всего слайдов:
    45 слайдов
  • Для класса:
    1,2,3,4,5,6,7,8,9,10,11
  • Размер файла:
    860.00 kB
  • Просмотров:
    82
  • Скачиваний:
    0
  • Автор:
    неизвестен



Слайды и текст к этой презентации:

№1 слайд
Lesson Working with Objects
Содержание слайда: Lesson 5 Working with Objects

№2 слайд
Objectives After completing
Содержание слайда: Objectives After completing this lesson, you should be able to: Declare, instantiate, and initialize object reference variables Compare how object reference variables are stored in relation to primitive variables Access fields on objects Call methods on objects Create a String object Manipulate data by using the String class and its methods Manipulate data by using the StringBuilder class and its methods Use the Java API documentation to explore the methods of a foundation class

№3 слайд
Topics Declaring,
Содержание слайда: Topics Declaring, instantiating, and initializing objects Working with object references Using the String class Using the Java API documentation Using the StringBuilder class

№4 слайд
Working with Objects
Содержание слайда: Working with Objects: Introduction Objects are accessed via references. Objects are instantiated versions of their class. Objects consist of attributes and operations: In Java, these are fields and methods.

№5 слайд
Accessing Objects by Using a
Содержание слайда: Accessing Objects by Using a Reference

№6 слайд
Shirt Class
Содержание слайда: Shirt Class

№7 слайд
Topics Declaring,
Содержание слайда: Topics Declaring, instantiating, and initializing objects Working with object references Using the String class Using the Java API documentation Using the StringBuilder class

№8 слайд
Working with Object Reference
Содержание слайда: Working with Object Reference Variables Declaration: Classname identifier;

№9 слайд
Declaring and Initializing
Содержание слайда: Declaring and Initializing: Example

№10 слайд
Working with Object References
Содержание слайда: Working with Object References

№11 слайд
Working with Object References
Содержание слайда: Working with Object References

№12 слайд
Working with Object References
Содержание слайда: Working with Object References

№13 слайд
References to Different
Содержание слайда: References to Different Objects

№14 слайд
References to Different
Содержание слайда: References to Different Object Types

№15 слайд
References and Objects In
Содержание слайда: References and Objects In Memory

№16 слайд
Assigning a Reference to
Содержание слайда: Assigning a Reference to Another Reference

№17 слайд
Two References, One Object
Содержание слайда: Two References, One Object

№18 слайд
Assigning a Reference to
Содержание слайда: Assigning a Reference to Another Reference

№19 слайд
Quiz Which of the following
Содержание слайда: Quiz Which of the following lines of code instantiates a Boat object and assigns it to a sailBoat object reference? Boat sailBoat = new Boat(); Boat sailBoat; Boat = new Boat() Boat sailBoat = Boat();

№20 слайд
Topics Declaring,
Содержание слайда: Topics Declaring, instantiating, and initializing objects Working with object references Using the String class Using the Java API documentation Using the StringBuilder class

№21 слайд
String Class The String class
Содержание слайда: String Class The String class supports some non-standard syntax A String object can be instantiated without using the new keyword; this is preferred: String hisName = "Fred Smith"; The new keyword can be used, but it is not best practice: String herName = new String("Anne Smith"); A String object is immutable; its value cannot be changed. A String object can be used with the string concatenation operator symbol (+) for concatenation.

№22 слайд
Concatenating Strings When
Содержание слайда: Concatenating Strings When you use a string literal in Java code, it is instantiated and becomes a String reference Concatenate strings: String name1 = "Fred" theirNames = name1 + " and " + "Anne Smith"; The concatenation creates a new string, and the String reference theirNames now points to this new string.

№23 слайд
Concatenating Strings
Содержание слайда: Concatenating Strings

№24 слайд
Concatenating Strings
Содержание слайда: Concatenating Strings

№25 слайд
Concatenating Strings
Содержание слайда: Concatenating Strings

№26 слайд
String Method Calls with
Содержание слайда: String Method Calls with Primitive Return Values A method call can return a single value of any type. An example of a method of primitive type int: String hello = "Hello World"; int stringLength = hello.length();

№27 слайд
String Method Calls with
Содержание слайда: String Method Calls with Object Return Values Method calls returning objects: String greet = " HOW ".trim(); String lc = greet + "DY".toLowerCase(); Or String lc = (greet + "DY").toLowerCase();

№28 слайд
Method Calls Requiring
Содержание слайда: Method Calls Requiring Arguments Method calls may require passing one or more arguments: Pass a primitive String theString = "Hello World"; String partString = theString.substring(6); Pass an object boolean endWorld = "Hello World".endsWith("World");

№29 слайд
Topics Declaring,
Содержание слайда: Topics Declaring, instantiating, and initializing objects Working with object references Using the String class Using the Java API documentation Using the StringBuilder class

№30 слайд
Java API Documentation
Содержание слайда: Java API Documentation Consists of a set of webpages; Lists all the classes in the API Descriptions of what the class does List of constructors, methods, and fields for the class Highly hyperlinked to show the interconnections between classes and to facilitate lookup Available on the Oracle website at: http://download.oracle.com/javase/7/docs/api/index.html

№31 слайд
Java Platform SE Documentation
Содержание слайда: Java Platform SE 7 Documentation

№32 слайд
Java Platform SE Documentation
Содержание слайда: Java Platform SE 7 Documentation

№33 слайд
Java Platform SE Method
Содержание слайда: Java Platform SE 7: Method Summary

№34 слайд
Java Platform SE Method Detail
Содержание слайда: Java Platform SE 7: Method Detail

№35 слайд
System.out Methods To find
Содержание слайда: System.out Methods To find details for System.out.println(), consider the following: System is a class (in java.lang). out is a field of System. out is a reference type that allows calling println() on the object type it references. To find the documentation: Go to System class and find the type of the out field. Go to the documentation for that field. Review the methods available.

№36 слайд
Documentation on
Содержание слайда: Documentation on System.out.println()

№37 слайд
Using the print and println
Содержание слайда: Using the print() and println() Methods The println method: System.out.println(data_to_print); Example: System.out.print("Carpe diem "); System.out.println("Seize the day"); This method prints the following: Carpe diem Seize the day

№38 слайд
Topics Declaring,
Содержание слайда: Topics Declaring, instantiating, and initializing objects Working with object references Using the String class Using the Java API documentation Using the StringBuilder class

№39 слайд
StringBuilder Class
Содержание слайда: StringBuilder Class StringBuilder provides a mutable alternative to String. StringBuilder: Is a normal class. Use new to instantiate. Has an extensive set of methods for append, insert, delete Has many methods to return reference to current object. There is no instantiation cost. Can be created with an initial capacity best suited to need String is still needed because: It may be safer to use an immutable object A class in the API may require a string It has many more methods not available on StringBuilder

№40 слайд
StringBuilder Advantages over
Содержание слайда: StringBuilder Advantages over String for Concatenation (or Appending) String concatenation Costly in terms of creating new objects

№41 слайд
StringBuilder Declare and
Содержание слайда: StringBuilder: Declare and Instantiate

№42 слайд
StringBuilder Append
Содержание слайда: StringBuilder Append

№43 слайд
Quiz Which of the following
Содержание слайда: Quiz Which of the following statements are true? (Choose all that apply.) The dot (.) operator creates a new object instance. The String class provides you with the ability to store a sequence of characters. The Java API specification contains documentation for all of the classes in a Java technology product. String objects cannot be modified.

№44 слайд
Summary Objects are accessed
Содержание слайда: Summary Objects are accessed via references: Objects are instantiated versions of their class. Objects consist of attributes and operations: In Java, these are fields and methods. To access the fields and methods of an object, get a reference variable to the object: The same object may have more than one reference. An existing object’s reference can be reassigned to a new reference variable. The new keyword instantiates a new object and returns a reference.

№45 слайд
Practice for Lesson Overview
Содержание слайда: Practice for Lesson 5 Overview: In this practice, you create instances of a class and manipulate these instances in several ways. During the practice, you: Create and initialize object instances Manipulate object references In this practice, you create, initialize, and manipulate StringBuilder objects In this practice, you examine the Java API specification to become familiar with the documentation and with looking up classes and methods. You are not expected to understand everything you see. But as you progress through this course, you will understand more and more of the Java API documentation.

Скачать все slide презентации Lesson 5. Working with Objects одним архивом: