跳到主要內容

【 Android Development for Beginners】 Lesson 3A : Object Oriented Programming - 3

This Notes is according to the udacity free course :

Android Development for Beginners

Lesson 3A : Object Oriented Programming

Resources









What are Java objects




There are 2 easy samples for you to understand what is Java class ?
These are the most important part of this section.





How to create object

1. create object with constructor(regular style)


2. create object with factory methods (need to check out the object documentation)


The quiz focus on too much detail,so I provide the answer for you to check.
TextView textView = new TextView(context);
ImageView img = new ImageView(context);
ToggleButton button = new ToggleButton(context);
Toast toast = Toast.makeText(context, text, duration);


The different between object and class
reference:diffen

class is like a blue map for you to construct object
class can include many state and methods


留言

這個網誌中的熱門文章

【Android Development for Beginners】 Lesson 2A : Create a New Project , Plan How to Build the Layout, Build Layout

This Notes is according to the udacity free course : Android Development for Beginners Lesson 2A : Create a New Project Plan How to Build the Layout Build layout Follow the instruction below to build up a new app called "Just Java" use empty activity .

【Android Development for Beginners】Lesson 2A : Update a Variable in the App

This Notes is according to the udacity free course : Android Development for Beginners The Notes below are my own notes in class. Lesson 2A :  Update a Variable in the App When you put new variable in the MainActivity.java you will get a new results when you press the button"+"

【Android Development for Beginners】Lesson 2B : String Data Type, Combining Strings Together, and Integer Variables

This Notes is according to the udacity free course : Android Development for Beginners Lesson 2B :  String Data Type,  Combining Strings Together and Integer Variables Finally We cross the river and change the layouts successfully. But We can do it better by letting the price change automatically but not change after the we click the "order" button. So this is what we want to do in this class.