SlideServe
Menu
Préférences
© SlideServe · v2026

Introduction to Objects and Classes in Programming: Fundamental Concepts

yardley-pittman avatar
16 diapositives · 296 Views · Nov 15, 2014

This lecture provides a comprehensive introduction to the fundamental concepts of objects and classes in programming, focusing specifically on Java. It covers key topics such as defining a class and its objects, the concept of methods and parameters, and the strong typing of the Java language. You'll learn about object instantiation, the operations that can be performed on objects, the state of an object, and how to manage class methods, including return types. This foundational knowledge is essential for developing Java applications.

Introduction to Objects and Classes in Programming: Fundamental Concepts - slide 1
01 / 16Introduction to Objects and Classes in Programming: Fundamental Concepts
1 / 17

Télécharger la présentation

Introduction to Objects and Classes in Programming: Fundamental Concepts
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Objects and Classes First Programming Concepts

  2. Fundamental Concepts • object • class • method • parameter • data type Lecture 1a: Introduction

  3. Objects and Classes • Objects • represent ‘things’ from the real world, or from some problem domain (example: “the red car down there in the car park”) • Classes • represent all objects of a kind (example: “car”) Objects represent individual instantiations of the class. Object are instantiated. Lecture 1a: Introduction

  4. Objects and Classes in BlueJ Lecture 1a: Introduction

  5. Things we can do with Objects Lecture 1a: Introduction

  6. Things we can do with Objects Lecture 1a: Introduction

  7. Methods and Parameters • Objects/classes have operations which can be invoked.They are called methods • void moveHorizontal(int distance) is called the signature of the methods • The collection of methods of a class is referred to as the interface of that class • methods may have parameters to pass additional information needed to execute • Methods are called or invoked Lecture 1a: Introduction

  8. Data Types • Parameters have types. A type defines what kinds of values a parameter can take. • Defining a class defines a type • In Java, everything has a type. • Java is strongly typed language • Examples of types: int, String, Circle, … Lecture 1a: Introduction

  9. Other Observations • many instances can be created from a single class • an object has attributes: values stored in fields. • the class defines what fields an object has, but each object stores its own set of values. • These set of values is called the state of the object. Lecture 1a: Introduction

  10. State Lecture 1a: Introduction

  11. Two Circle Objects Lecture 1a: Introduction

  12. Object Interaction Lecture 1a: Introduction

  13. Source Code • Each class has source code (Java code) associated with it that defines its details (fields and methods). • In other words, it determines the structure and the behavior of each of its instance. • This source code is compiled and interpreted by Java. Lecture 1a: Introduction

  14. Return Values • Methods may return a result via a return value. • Example: String getName() • This method returns a String. • Example: void changeName() • Void indicates that this method does not return anything Lecture 1a: Introduction

  15. Developing Java Programs • To learn to develop Java programs, one needs to learn how to write class definitions, including fields and methods, and how to put these classes together as well • During the rest of this unit we will deal with these issues in more detail Lecture 1a: Introduction

  16. Object Instance State Compiler Virtual Machine Method Calling Class Method Return Value Signature Parameter Type Source Code Terms Lecture 1a: Introduction