西安电子科技大学:《Mobile Programming》课程PPT教学课件(Android Programming)Lecture 2 Intro to Java Programming

Android Programming Lecture 2 Intro to Java Programming
Android Programming Lecture 2 Intro to Java Programming

Agenda Classes Objects Overview Packages ·| nheritance Abstraction Interfaces Nested Classes o Static nested Inner classes o Local anonymous classes
Agenda • Classes & Objects Overview • Packages • Inheritance • Abstraction • Interfaces • Nested Classes o Static nested & Inner classes o Local & anonymous classes 2

Objectives Identify the basic parts of a Java program Can identify a class and components of a class Read the codes in an app
Objectives • Identify the basic parts of a Java program • Can identify a class and components of a class • Read the codes in an app 3

Dot if the baby is within 1-2 years old if the baby is happy today if the milk is still hot else else else else.1 while(the baby is not 6 years old) A computer would ask you to What is a baby Define it What is a feeding bottle? Define it 我们该如何教授计 算机去理解我们? What is milk? Define! 4
4 Do{ if the baby is within 1-2 years old if the baby is happy today if the milk is still hot if … else … else …. else … else…} while(the baby is not 6 years old) A computer would ask you to: • What is a baby? Define it! • What is a feeding bottle? Define it! • What is milk? Define! 我们该如何教授计 算机去理解我们?

Class and object
Class and Object 5

What is an“ Object An object is a thing that we teach to the computer, so that the computer knows what the thing is Unlike people, a computer cannot see, feel and smell. It can only read codes. We have to define objects(or things)by describing the objects using (programming) languages The way we describe a thing is composed of two parts o Attributes(variables, properties ) What an object has o Methods: what an object can do
What is an “Object” • An object is a thing, that we teach to the computer, so that the computer knows what the thing is • Unlike people, a computer cannot see, feel and smell. It can only read codes. We have to define objects (or things) by describing the objects using (programming) languages. • The way we describe a thing is composed of two parts o Attributes (variables, properties): what an object has o Methods: what an object can do 6

Bicycle Music Music Player
7 Bicycle Music Music Player

Example: Bicycle Define the object for computers by specifying o The properties the object has o The functions the object provides Attributes Method o cadence o set cadence o gear o set the gear o speed o speed up o brake
Example: Bicycle 8 • Attributes: o cadence o gear o speed • Method: o set cadence o set the gear o speed up o brake • Define the object for computers by specifying o The properties the object has o The functions the object provides

package com. example test; //A bicycle class Example taken from Oracle Docs public class Bicycle t public int cadence; public int gear public int speed public Bicycle(int startCadence, int startspeed, int startGear) gear startGearj cadence startCadence; speed startspeed public void setCadence(int newValue)t cadence newValue public void setGear(int newValue)i gear newvaluej public void apply Brake(int decrement )i speed - decrement Bicycle public void speedUp(int increment)t speed + increment;
9 Bicycle

package com. example test; //A bicycle class Example taken from Oracle Docs public class Bicycle t Bicycle Class o can be thought of as a template, a prototype or a blueprint of an object o is the fundamental structure in object-oriented programming 10
10 Class o can be thought of as a template, a prototype or a blueprint of an object o is the fundamental structure in object-oriented programming Bicycle
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《计算机网络》课程教学资源(考试大纲)计算机网络考试大纲.doc
- 《数据结构与算法》课程教学资源(PPT课件讲稿)第三章 树 3.1 树的有关定义.ppt
- 西安培华学院:《微机原理》课程教学资源(PPT课件讲稿)第一章 绪论.ppt
- 《单片机原理及应用》课程PPT教学课件(C语言版)第4章 C51程序设计入门(单片机C语言及程序设计).ppt
- 《Visual Basic程序设计》课程教学资源(PPT课件讲稿)第四章 VB的基本语句.pps
- 哈尔滨工业大学:再探深度学习词向量表示(PPT课件讲稿)Advanced word vector representations(主讲人:李泽魁).ppt
- 中国科学技术大学:《Linux操作系统分析》课程教学资源(PPT课件讲稿)文件系统.ppt
- 华北科技学院:数字视频教学软件与制作(PPT课件讲稿)数字视频编辑软件Premiere 6.5(主讲:于文华).ppt
- Introduction to Convolution Neural Networks(CNN)and systems.pptx
- 《编译原理》课程教学资源(PPT课件讲稿)第八章 代码生成.ppt
- 《数字图像处理》课程PPT教学课件(讲稿)第四章 点运算.ppt
- 《计算机系统安全》课程教学资源(PPT课件讲稿)第七章 公开密钥设施PKI Public key infrastructure.ppt
- 《密码学》课程教学资源(PPT课件讲稿)第10章 密码学的新方向.ppt
- 清华大学:Local Area Network and Ethernet(PPT课件讲稿).pptx
- 《计算机组成与设计》课程教学资源(PPT课件讲稿)第2章 指令——计算机的语言.ppt
- 《数据挖掘导论 Introduction to Data Mining》课程教学资源(PPT课件讲稿)Data Mining Classification(Basic Concepts, Decision Trees, and Model Evaluation).ppt
- 《微型计算机原理及接口技术》课程电子教案(PPT课件)第9章 AT89S52单片机的I/O扩展.ppt
- 四川大学:《计算机网络 Computer Networks》课程教学资源(PPT课件讲稿)Unit5 Introduction to Computer Networks.ppt
- 《计算机软件技术基础》课程教学资源(PPT课件讲稿)排序(教师:曾晓东).ppt
- 西安电子科技大学:《数据库系统 DataBase System》课程教学资源(PPT课件讲稿)normalization.ppt
- 西安电子科技大学:《数据库系统 DataBase System》课程教学资源(PPT课件讲稿)Unit 2 The Relational Model.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第6章 用数组处理批量数据.pptx
- 电子工业出版社:《计算机网络》课程教学资源(第六版,PPT课件讲稿)第六章 应用层.pptx
- 清华大学:《计算机导论》课程电子教案(PPT教学课件)第3章 计算机基础知识.ppt
- 中国科学技术大学:《现代密码学理论与实践》课程教学资源(PPT课件讲稿)第4章 有限域(第五版).pptx
- 西安电子科技大学:《数据库系统 DataBase System》课程教学资源(PPT课件讲稿)Unit 3 SQL.ppt
- 《人工智能技术导论》课程教学资源(PPT课件讲稿)第2章 逻辑程序设计语言.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第六章 查找.ppt
- 上海交通大学:云安全(PPT讲稿)Cloud Security.pptx
- 《计算机网络》课程教学大纲(适用专业:信息与计算科学).pdf
- 江苏大学:《面向对象建模技术》课程教学资源(PPT课件讲稿)第2章 用例图.ppt
- 《网络营销实务》课程教学资源(PPT课件讲稿)第二章 网络营销环境分析.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第七章 搜索结构第七章 搜索结构.ppt
- 丽水职业技术学院:《电子商务实训》课程教学资源(PPT课件讲稿)电子商务交易模式之“B2B”——电子合同模式.ppt
- 《电子商务概论》课程教学资源(PPT课件讲稿)第六章 电子商务支付技术.ppt
- 浙江长征职业技术学院:计算机信息管理专业课程教学大纲汇编.doc
- 北京林业大学:《深度学习》课程PPT教学课件(Deep Learning)第二章 神经网络与优化方法(主讲:孙钰).pptx
- 《Advanced Artificial Intelligence》课程PPT教学课件(高级人工智能)Lecture 5 Neural Networks.pptx
- 《Advanced Artificial Intelligence》课程PPT教学课件(高级人工智能)Lecture 3 Decision Tree.pptx
- 《Advanced Artificial Intelligence》课程PPT教学课件(高级人工智能)Lecture 6 Convolutional Neural Network.pptx