Welcome back to Software Development!

Slides:



Advertisements
Similar presentations
Introduction to classes Sangeetha Parthasarathy 06/11/2001.
Advertisements

1.00 Lecture 11 Scope and Access. Variable Lifecycles Instance (or object) variables – Created when their containing object is created – Initialized to.
Local Variables and Scope Benjamin Fein. Variable Scope A variable’s scope consists of all code blocks in which it is visible. A variable is considered.
Variable types We have already encountered the idea of a variable type. It is also possible to think about variables in terms of their kind, namely: 1)
Lecture 2 Basics of C#. Members of a Class A field is a variable of any type that is declared directly in a class. Fields are members of their containing.
Summary of the lecture We discussed –variable scope –instance variable declarations –variable lifetime.
Access to Names Namespaces, Scopes, Access privileges.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 13P. 1Winter Quarter Scope of Variables.
1 Classes, Encapsulation, Methods and Constructors Class definitions Scope of Data –Instance data –Local data The this Reference Encapsulation and Java.
Introduction to Programming with Java, for Beginners Scope.
Slides prepared by Rose Williams, Binghamton University Chapter 13 Interfaces and Inner Classes.
©2004 Brooks/Cole Chapter 10 More on Classes. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Object assignment With primitive types, setting.
The different kinds of variables in a Java program.
State,identity and behavior of objects Sem III K.I.R.A.S.
Lecture From Chapter 6 & /8/10 1 Method of Classes.
A class in Java is a software construct that includes fields (also called data fields or class scope variables) to provide data specification, and methods.
Chapter 4 -2 part Writing Classes 5 TH EDITION Lewis & Loftus java Software Solutions Foundations of Program Design © 2007 Pearson Addison-Wesley. All.
Recitation 2 James Wei Professor Peck 1/17/2013. Covered in this Recitation Arrays Variable Scoping Local variables Instance variables Class variables.
1 Chapter Four Creating and Using Classes. 2 Objectives Learn about class concepts How to create a class from which objects can be instantiated Learn.
Classes: user-defined types. Organizing method with a class A class is used to organize methods * Methods that compute Mathematical functions * The Scanner.
1. 2  Classes are not just containers for methods ◦ Virtually all are classes ◦ Blueprint/Cookie Cutter/Recipe ◦ Objects – instance of the class (new)
SEEM3460 Tutorial Java Keyword – static. static Variables class XY { static int x; // class variable int y; // instance variable } XY xy1 = new XY();
CSCI 3328 Object Oriented Programming in C# Chapter 9: Classes and Objects: A Deeper Look – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley.
Advanced Java class Nested Classes & Interfaces. Types of Nested Classes & Interfaces top-level nested –classes –interfaces inner classes –member –local.
Classes CS 162 (Summer 2009). Parts of a Class Instance Fields Methods.
Java 5 Class Anatomy. User Defined Classes To this point we’ve been using classes that have been defined in the Java standard class library. Creating.
Objective - To multiply polynomials.
External Scope CECS 277 Mimi Opkins.
Name Spaces: ALL versus OOL
Classes (Part 1) Lecture 3
Examples of Classes & Objects
The Lifetime of a Variable
Object-Oriented Programming: Classes and Objects
Encapsulation, Data Hiding and Static Data Members
Lecture 5: Some more Java!
PHP Classes and Objects
Lecture 4 D&D Chapter 5 Methods including scope and overloading Date.
Elements of the PHP Programming Environment
Object-Oriented Programming: Classes and Objects
PHP Functions, Scope MIS 3501, Fall 2015 Jeremy Shafer
Nested class.
Interfaces and Inner Classes
Iteration CSCE 121 J. Michael Moore.
Encapsulation.
Classes & Objects: Examples
Inner Classes 29-Nov-18.
CSCI 3328 Object Oriented Programming in C# Chapter 9: Classes and Objects: A Deeper Look – Exercises UTPA – Fall 2012 This set of slides is revised from.
Welcome back to Software Development!
Classes and Objects.
The University of Texas – Pan American
Welcome back to Software Development!
The lifespan of a variable
Chapter 8 Classes User-Defined Classes and ADTs
Welcome back to Software Development!
© A+ Computer Science - Classes And Objects © A+ Computer Science -
© A+ Computer Science - OOP Pieces © A+ Computer Science -
Tonga Institute of Higher Education
ECE 103 Engineering Programming Chapter 12 More C Statements
Welcome back to Software Development!
Method of Classes Chapter 7, page 155 Lecture /4/6.
Inner Classes 17-Apr-19.
Inner Classes 21-Apr-19.
Chapter 9 Objects and Classes
Inner Classes 1-May-19.
Welcome back to Software Development!
Inner Classes 11-May-19.
Inner Classes 18-May-19.
ITE “A” GROUP 2 ENCAPSULATION.
Chapter 5 Classes.
Presentation transcript:

Welcome back to Software Development!

Reading Questions

Reading Questions What are scope modifiers (public/private)

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class)

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business)

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business) Can only use it from inside the class it is part of

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business) Can only use it from inside the class it is part of public – it is “public knowledge”

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business) Can only use it from inside the class it is part of public – it is “public knowledge” The “general public” (anyone outside the class) can use/change it

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business) Can only use it from inside the class it is part of public – it is “public knowledge” The “general public” (anyone outside the class) can use/change it Scope exercise…

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business) Can only use it from inside the class it is part of public – it is “public knowledge” The “general public” (anyone outside the class) can use/change it Scope exercise… Curly braces create a “block” of code

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business) Can only use it from inside the class it is part of public – it is “public knowledge” The “general public” (anyone outside the class) can use/change it Scope exercise… Curly braces create a “block” of code Scope means “where the name can be used”

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business) Can only use it from inside the class it is part of public – it is “public knowledge” The “general public” (anyone outside the class) can use/change it Scope exercise… Curly braces create a “block” of code Scope means “where the name can be used” Determined by the curly braces { } that surround it

Reading Questions What are scope modifiers (public/private) Qualify what can access the name (either inside or outside the class) Now called access modifiers private – it is “PB” (private business) Can only use it from inside the class it is part of public – it is “public knowledge” The “general public” (anyone outside the class) can use/change it Scope exercise… Curly braces create a “block” of code Scope means “where the name can be used” Determined by the curly braces { } that surround it Inner blocks have access to stuff in outer blocks’ scope

Reading Questions What are scope modifiers (public/private)

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work Fields

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work Fields What the book calls “instance variables”

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work Fields What the book calls “instance variables” The data or information the class uses

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work Fields What the book calls “instance variables” The data or information the class uses The class variables that any method of the class can use

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work Fields What the book calls “instance variables” The data or information the class uses The class variables that any method of the class can use Properties

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work Fields What the book calls “instance variables” The data or information the class uses The class variables that any method of the class can use Properties Sometimes called “smart fields”

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work Fields What the book calls “instance variables” The data or information the class uses The class variables that any method of the class can use Properties Sometimes called “smart fields” Methods that look like fields…you can use them almost like variables

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? Methods The actual code that does the work Fields What the book calls “instance variables” The data or information the class uses The class variables that any method of the class can use Properties Sometimes called “smart fields” Methods that look like fields…you can use them almost like variables They “protect” the class variables (fields)

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters?