JAVA CLASSES, METHODS AND VARIABLES.  Defined Noun: A set or category of things having some property or attribute in common and differentiated from others.

Slides:



Advertisements
Similar presentations
CPSC 388 – Compiler Design and Construction
Advertisements

Program Memory MIPS memory operations Getting Variable Addresses Advanced structures.
Chapter 9 Pointers and Dynamic Arrays. Overview 9.1 Pointers 9.2 Dynamic Arrays.
CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Introduction to Computing Concepts Note Set 7. Overview Variables Data Types Basic Arithmetic Expressions ▫ Arithmetic.
Introduction to C# Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Objects First With Java A Practical Introduction Using BlueJ Improving structure with inheritance 2.0.
Animation Mrs. C. Furman. Animation  We can animate our crab by switching the image between two pictures.  crab.png and crab2.png.
Chapter 2 Review Questions
Greenfoot Asteroids Mrs. C. Furman August 16, 2010.
INTRODUCING OUR LANGUAGE: C# CHAPTER Topics  The Features of C# –C# is an Interpreted Language –C# is Managed Code –C# is Strongly Typed –C# is.
INTRODUCING OUR LANGUAGE: C# CHAPTER Topics  The Features of C# –C# is a Compiled Language –C# is Managed Code –C# is Strongly Typed –C# is Function.
OBJECT-ORIENTED PROGRAMMING CONCEPTS (Review). What is an Object? What is an Object? Objects have states and behaviors. Example: A dog has states - color,
Improving structure with inheritance
Objectives Learn about objects and reference variables Explore how to use predefined methods in a program.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
1 Lecture Today’s topic Arrays Reading for this Lecture: –Chaper 11.
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
SUNY Morrisville-Norwich Campus-Week 12 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Object-oriented Programming Concepts
1 MATERI PENDUKUNG OPERATOR Matakuliah: M0074/PROGRAMMING II Tahun: 2005 Versi: 1/0.
The different types of variables in a Java program.
Introduction to Class Modules Please use speaker notes for additional information!
Object Oriented Software Development
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Chapter 4 Objects and Classes.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
Introduction to Programming Writing Java Beginning Java Programs.
Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015 C Tutorial CIS5027.
Chapter 2 Practice.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Java 2 More Java Then Starbucks ;-). Important Terms Primitive Data – Basic, built-in values (characters & numbers) Data Type – Used to talk about values.
1 Classes and Objects in C++ 2 Introduction Java is a true OO language and therefore the underlying structure of all Java programs is classes. Anything.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
CIS1402 – Introduction to CIS Tom Gustafson. * An object is an entity that has attributes and methods. * Ex: A light bulb is an object. * The attributes.
The character data type char. Character type char is used to represent alpha-numerical information (characters) inside the computer uses 2 bytes of memory.
Classes: user-defined types. Organizing method with a class A class is used to organize methods * Methods that compute Mathematical functions * The Scanner.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Classes and Methods. Classes Class Definition Data Fields –Variables to store data items –Differentiate multiple objects of a class –They are called.
Introduction to OOP in VB.NET using Robots ACSE Conference, Nov 2004 Michael Devoy Monsignor Doyle C.S.S., Cambridge
CS100A, Fall 1998 Key Concepts 1 These notes contain short definitions of the basic entities that make up a Java program, along with a description of the.
What Is a Package? A package is a namespace that organizes a set of related classes and interfaces. Conceptually you can think of packages as being similar.
Algorithms and Computer Programming. Algorithms algorithm is an ordered sequence of instructions for solving a problem. Look at it as a building blocks.
By : Robert Apeldorn. What is OOP?  Object-oriented programming is a programming paradigm that uses “objects” to design applications and computer programs.
POINTERS IN C. Introduction  A pointer is a variable that holds a memory address  This address is the location of another object (typically another.
Chapter 2 – The Little Crab Program:. Little Crab Scenario Inheritance: The Arrows Denote Hierarchy Crab is an Animal Animal is an Actor Therefore, It.
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Jeopardy $100 VariablesErrorsLoops Classes and Objects Program Structure $200 $300 $400 $500 $400 $300 $200 $100 $500 $400 $300 $200 $100 $500 $400 $300.
CS100Lecture 61 Announcements Homework P1 due on Thursday Homework P2 handed out.
Data Type and Function Prepared for CSB210 Pemrograman Berorientasi Objek By Indriani Noor Hapsari, ST, MT Source: study.
Objects, Classes, and Methods
Objects, Functions and Parameters
Road Map Introduction to object oriented programming. Classes
Programming Language Concepts (CIS 635)
PRG 421 Week 1 Individual: Week One Coding Assignment--
An Introduction to Java – Part II
Unit-1 Introduction to Java
Programming paradigms
Object-Oriented Programming
Implementing Classes Chapter 3.
Statements and expressions - java
2 code samples int [] array; int i, j, temp; for(i = 0; i < array.length/2; i++) { j = array.length-1-i; temp = array[i]; array[i] = array[j]; array[j]
Java Programming Language
C Programming Pointers
Improving structure with inheritance
Chapter (3) - Procedures
Arrays Introduction to Arrays Reading for this Lecture:
Scope Rules.
Introduction to Pointers
Presentation transcript:

JAVA CLASSES, METHODS AND VARIABLES

 Defined Noun: A set or category of things having some property or attribute in common and differentiated from others by kind, type, or quality.  For example, a "Banana" class would represent the properties and functionality of bananas in general.  Here we have the class. “Bug” as you can see we have declared the class in the statement. A CLASS

 #LO2: A Java class is a group of Java methods and variables.  #LO3: A Java method is a set of Java statements which can be included inside a Java class. OBJECTIVES

 A procedure for accomplishing something.  The Bicycle class uses the following lines of code to define its fields:  public int cadence;  public int gear;  public int speed;  Here, we have the method “Act” A METHOD

 Variables are devices that store data in memory (much like short our short term memory).  ‘Int’ is used here in the mover class to declare the data type Integer.  Which variables can you see here. A VARIABLE

 #LO4: Development of code with a Mover class. Inheriting methods from a class.  #LO5: Introduction to the code editor to add code to make actors move. OBJECTIVES *The 'Mover' class is a subclass of Actor. * A Mover is an actor that also has 'move' and 'turn' ability. Both moving and turning * are relative to its current position. When moving, the Mover will move in the direction * it is currently facing. * Both 'move' and 'turn' methods are available with or without parameters.