SlideShare a Scribd company logo
1 of 19
Download to read offline
Android Lecture1
Lectured by 37th KIM JIAE
JAVA
강의계획서
1주차: 자바 및 기본 레이아웃(텍스트, 버튼 클릭) / 과제: 계산기(에딧, 버튼)
2주자: 리스트, 이미지, 레이아웃 관련 위젯들/ 과제: 앱 디자인 관련 과제
3주차: 프로그래스 바, 쓰레드, 핸들러/과제: 게임(시간제한 있는 간단한 게임 제작)
4주차: 블루투스 /센서 값 받아 오기, 입력한 값에 따라 LED 점등(UNO/ATMega128)
5주차~개강 전: (신청인원) 팀 프로젝트 – 팀당 3~4명
일 월 화 수 목 금 토
1/1 1/2 1/3 1/4 1/5 1/6 1/7
1/8 1/9 1/10 1/11 1/12 1/13 1/14
1/15 1/16 1/17 1/18 1/19 1/20 1/21
1/22 1/23 1/24 1/25 1/26 1/27 1/28
1/29 1/30 1/31 2/1 2/2 2/3 2/4
1주차
2주차
3주차
4주차
5주차 ~ 개강 전까지
1주차
JAVA의 기본
JAVA
C언어 vs JAVA
1. 단순!
(포인터, 구조체 없음, garbage
collection 기능 등)
2. 객체지향적(Object-Oriented)
3. VM(Virtual Machine)에서 동작
(다양한 기기에서 동작 가능!)
객체지향이 뭐지?
실제 사물들을 컴퓨터 내에서 ‘객체’로 모델링
객체끼리 메시지를 주고받고, 데이터를 처리함.
‘사람’
Class
‘동빈이’
객체
‘유밍디’
객체
성별: 남자
나이: 21
말한다
성별: 여자???????
나이: 24
말한다
Class는 뭐지?
Class
속성
attribute
행동
Method
Class Person{
private boolean gender;
private int age;
public void say(int mAge){
if(mAge >age)
System.out.println(“안녕하세요”);
else System.out.println(“안녕?”);
}
public void setAge(int mAge){
age = mAge;
}
public int getAge(){
return age;
}
public void setGender(boolean mGender){
gender = mGender;
}
public boolean getGender(){
return gender;
}
}
Class는 뭐지?
Public class Test{
public static void main(String[] args){
Person Minji, Dongbin;
Minji = new Person(24,True);
Dongbin = new Person(21, False);
Dongbin.say(Minji.getAge());
Minji.say(Dongbin.getAge());
}
Class Person{
private boolean gender;
private int age;
public void say(int mAge){
if(mAge >age)
System.out.println(“안녕하세요”);
else System.out.println(“안녕?”);
}
public void setAge(int mAge){
age = mAge;
}
public int getAge(){
return age;
}
public void setGender(boolean mGender){
gender = mGender;
}
public boolean getGender(){
return gender;
}
}
결과 :
안녕하세요
안녕?
Class는 뭐지?
Public class Test{
public static void main(String[] args){
Person Minji, Dongbin;
Minji = new Person(24,True);
Dongbin = new Person(21, False);
Minji.age = 20;
Dongbin.say(Minji.getAge());
Minji.say(Dongbin.getAge());
}
Class Person{
public boolean gender;
public int age;
public void say(int mAge){
if(mAge >age)
System.out.println(“안녕하세요”);
else System.out.println(“안녕?”);
}
public void setAge(int mAge){
age = mAge;
}
public int getAge(){
return age;
}
public void setGender(boolean mGender){
gender = mGender;
}
public boolean getGender(){
return gender;
}
}
결과 :
안녕?
안녕하세요
Class는 뭐지?
Public class Test{
public static void main(String[] args){
Person Minji, Dongbin;
Minji = new Person(24,True);
Dongbin = new Person(21, False);
Minji.age = 20; // error!!!
Dongbin.say(Minji.getAge());
Minji.say(Dongbin.getAge());
}
Class Person{
private boolean gender;
private int age;
public void say(int mAge){
if(mAge >age)
System.out.println(“안녕하세요”);
else System.out.println(“안녕?”);
}
public void setAge(int mAge){
age = mAge;
}
public int getAge(){
return age;
}
public void setGender(boolean mGender){
gender = mGender;
}
public boolean getGender(){
return gender;
}
}
결과 :
민지가 정상적으로 인사를 받을 수 있음!
Class는 뭐지?
Public class Test{
public static void main(String[] args){
Person Minji, Dongbin;
Minji = new Person(24,True);
Dongbin = new Person(21, False);
}
Class Person{
private int gender;
private int age;
public Person(int mAge, boolean mGender)
{
gender = mGender;
age = mAge;
}
public ~Person(){
}
….중략
}
소멸자 없음!
Garvage Collaction
생성자
Class는 뭐지?
Public class Test{
public static void main(String[] args){
Person Minji, Dongbin;
Minji = new Person(24,True);
Dongbin = new Person(21, False);
}
Class Person{
private int gender;
private int age;
public Person(int mAge, boolean mGender)
{
gender = mGender;
age = mAge;
}
public Person()
{
}
….중략
}
생성자
오버로딩
Class의 상속!
‘Person’
Class
‘Professor’
Class
‘Student’
Class
이름
등록번호
말하다
이름
등록번호
말하다 가르치다
이름
등록번호
말하다 배우다
Class의 상속! 오버로딩
Class Person{
private boolean gender;
private int age;
public say(mGender,mAge)
{
//누나 안녕하세요!
//형 안녕하세요!
//안녕 ㅇㅇㅇ야!
}
public say()
{
//안녕하세요!
}
….중략
}
Class의 상속! 오버라이딩
Class Student extends Person{
private boolean gender;
private int age;
private int major;
public say()
{
//제 전공은 ~인 학생입니다!
}
….중략
}
Class의 끝판왕! 다형성
‘도형’
Class
‘삼각형’
Class
‘사각형’
Class
‘원’
Class
약간 다른 방법으로 일을 하는 함수를 동일한 이름으로 호출!
Draw()
삼각형을
그린다
Draw()
사각형을
그린다
Draw()
원을 그린다
Draw()
도형을 그린다
Class의 끝판왕! 다형성
Class Figure{
public draw(){
System.out.println(“도형을 그린다.”);
}
}
Class Polygon extends Figure{
public draw(){
System.out.println(“다각형을 그린다.”);
}
}
Class Square extends Polygon{
public draw(){
System.out.println(“사각형을 그린다.”);
}
}
Class Circle extends Figure{
public draw(){
System.out.println(“원을 그린다.”);
}
}
Class의 끝판왕! 다형성
Figure figure = new Figure();
Polygon polygon = new Polygon();
Square square = new Square();
Circle circle = new Circle();
figure.draw();
triangle.draw();
square.draw();
circle.draw();
도형을 그린다.
다각형을 그린다.
사각형을 그린다.
원을 그린다.
Class Figure{
public draw(){
System.out.println(“도형을 그린다.”);
}
}
Class Polygon extends Figure{
public draw(){
System.out.println(“다각형을 그린다.”);
}
}
Class Square extends Polygon{
public draw(){
System.out.println(“사각형을 그린다.”);
}
}
Class Circle extends Figure{
public draw(){
System.out.println(“원을 그린다.”);
}
}
Class의 끝판왕! 다형성
Figure name1 = new Figure();
Figure name2 = new Polygon();
Figure name3 = new Square();
Figure name4 = new Circle();
name1.draw();
name2.draw();
name3.draw();
name4.draw();
Class Figure{
public draw(){
System.out.println(“도형을 그린다.”);
}
}
Class Polygon extends Figure{
public draw(){
System.out.println(“다각형을 그린다.”);
}
}
Class Square extends Polygon{
public draw(){
System.out.println(“사각형을 그린다.”);
}
}
Class Circle extends Figure{
public draw(){
System.out.println(“원을 그린다.”);
}
}
도형을 그린다.
다각형을 그린다.
사각형을 그린다.
원을 그린다.
객체지향 정리!
추상화
캡슐화
상속성
다형성
Private
Public
사람 <– 학생
<- 교수
미묘하게 다른
함수들을 같은
이름으로 호출
Class
(객체들의 공통적인
특징!)
4가지
특징

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Android lecture1 java

  • 1. Android Lecture1 Lectured by 37th KIM JIAE JAVA
  • 2. 강의계획서 1주차: 자바 및 기본 레이아웃(텍스트, 버튼 클릭) / 과제: 계산기(에딧, 버튼) 2주자: 리스트, 이미지, 레이아웃 관련 위젯들/ 과제: 앱 디자인 관련 과제 3주차: 프로그래스 바, 쓰레드, 핸들러/과제: 게임(시간제한 있는 간단한 게임 제작) 4주차: 블루투스 /센서 값 받아 오기, 입력한 값에 따라 LED 점등(UNO/ATMega128) 5주차~개강 전: (신청인원) 팀 프로젝트 – 팀당 3~4명 일 월 화 수 목 금 토 1/1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 1/11 1/12 1/13 1/14 1/15 1/16 1/17 1/18 1/19 1/20 1/21 1/22 1/23 1/24 1/25 1/26 1/27 1/28 1/29 1/30 1/31 2/1 2/2 2/3 2/4 1주차 2주차 3주차 4주차 5주차 ~ 개강 전까지
  • 4. C언어 vs JAVA 1. 단순! (포인터, 구조체 없음, garbage collection 기능 등) 2. 객체지향적(Object-Oriented) 3. VM(Virtual Machine)에서 동작 (다양한 기기에서 동작 가능!)
  • 5. 객체지향이 뭐지? 실제 사물들을 컴퓨터 내에서 ‘객체’로 모델링 객체끼리 메시지를 주고받고, 데이터를 처리함. ‘사람’ Class ‘동빈이’ 객체 ‘유밍디’ 객체 성별: 남자 나이: 21 말한다 성별: 여자??????? 나이: 24 말한다
  • 6. Class는 뭐지? Class 속성 attribute 행동 Method Class Person{ private boolean gender; private int age; public void say(int mAge){ if(mAge >age) System.out.println(“안녕하세요”); else System.out.println(“안녕?”); } public void setAge(int mAge){ age = mAge; } public int getAge(){ return age; } public void setGender(boolean mGender){ gender = mGender; } public boolean getGender(){ return gender; } }
  • 7. Class는 뭐지? Public class Test{ public static void main(String[] args){ Person Minji, Dongbin; Minji = new Person(24,True); Dongbin = new Person(21, False); Dongbin.say(Minji.getAge()); Minji.say(Dongbin.getAge()); } Class Person{ private boolean gender; private int age; public void say(int mAge){ if(mAge >age) System.out.println(“안녕하세요”); else System.out.println(“안녕?”); } public void setAge(int mAge){ age = mAge; } public int getAge(){ return age; } public void setGender(boolean mGender){ gender = mGender; } public boolean getGender(){ return gender; } } 결과 : 안녕하세요 안녕?
  • 8. Class는 뭐지? Public class Test{ public static void main(String[] args){ Person Minji, Dongbin; Minji = new Person(24,True); Dongbin = new Person(21, False); Minji.age = 20; Dongbin.say(Minji.getAge()); Minji.say(Dongbin.getAge()); } Class Person{ public boolean gender; public int age; public void say(int mAge){ if(mAge >age) System.out.println(“안녕하세요”); else System.out.println(“안녕?”); } public void setAge(int mAge){ age = mAge; } public int getAge(){ return age; } public void setGender(boolean mGender){ gender = mGender; } public boolean getGender(){ return gender; } } 결과 : 안녕? 안녕하세요
  • 9. Class는 뭐지? Public class Test{ public static void main(String[] args){ Person Minji, Dongbin; Minji = new Person(24,True); Dongbin = new Person(21, False); Minji.age = 20; // error!!! Dongbin.say(Minji.getAge()); Minji.say(Dongbin.getAge()); } Class Person{ private boolean gender; private int age; public void say(int mAge){ if(mAge >age) System.out.println(“안녕하세요”); else System.out.println(“안녕?”); } public void setAge(int mAge){ age = mAge; } public int getAge(){ return age; } public void setGender(boolean mGender){ gender = mGender; } public boolean getGender(){ return gender; } } 결과 : 민지가 정상적으로 인사를 받을 수 있음!
  • 10. Class는 뭐지? Public class Test{ public static void main(String[] args){ Person Minji, Dongbin; Minji = new Person(24,True); Dongbin = new Person(21, False); } Class Person{ private int gender; private int age; public Person(int mAge, boolean mGender) { gender = mGender; age = mAge; } public ~Person(){ } ….중략 } 소멸자 없음! Garvage Collaction 생성자
  • 11. Class는 뭐지? Public class Test{ public static void main(String[] args){ Person Minji, Dongbin; Minji = new Person(24,True); Dongbin = new Person(21, False); } Class Person{ private int gender; private int age; public Person(int mAge, boolean mGender) { gender = mGender; age = mAge; } public Person() { } ….중략 } 생성자 오버로딩
  • 13. Class의 상속! 오버로딩 Class Person{ private boolean gender; private int age; public say(mGender,mAge) { //누나 안녕하세요! //형 안녕하세요! //안녕 ㅇㅇㅇ야! } public say() { //안녕하세요! } ….중략 }
  • 14. Class의 상속! 오버라이딩 Class Student extends Person{ private boolean gender; private int age; private int major; public say() { //제 전공은 ~인 학생입니다! } ….중략 }
  • 15. Class의 끝판왕! 다형성 ‘도형’ Class ‘삼각형’ Class ‘사각형’ Class ‘원’ Class 약간 다른 방법으로 일을 하는 함수를 동일한 이름으로 호출! Draw() 삼각형을 그린다 Draw() 사각형을 그린다 Draw() 원을 그린다 Draw() 도형을 그린다
  • 16. Class의 끝판왕! 다형성 Class Figure{ public draw(){ System.out.println(“도형을 그린다.”); } } Class Polygon extends Figure{ public draw(){ System.out.println(“다각형을 그린다.”); } } Class Square extends Polygon{ public draw(){ System.out.println(“사각형을 그린다.”); } } Class Circle extends Figure{ public draw(){ System.out.println(“원을 그린다.”); } }
  • 17. Class의 끝판왕! 다형성 Figure figure = new Figure(); Polygon polygon = new Polygon(); Square square = new Square(); Circle circle = new Circle(); figure.draw(); triangle.draw(); square.draw(); circle.draw(); 도형을 그린다. 다각형을 그린다. 사각형을 그린다. 원을 그린다. Class Figure{ public draw(){ System.out.println(“도형을 그린다.”); } } Class Polygon extends Figure{ public draw(){ System.out.println(“다각형을 그린다.”); } } Class Square extends Polygon{ public draw(){ System.out.println(“사각형을 그린다.”); } } Class Circle extends Figure{ public draw(){ System.out.println(“원을 그린다.”); } }
  • 18. Class의 끝판왕! 다형성 Figure name1 = new Figure(); Figure name2 = new Polygon(); Figure name3 = new Square(); Figure name4 = new Circle(); name1.draw(); name2.draw(); name3.draw(); name4.draw(); Class Figure{ public draw(){ System.out.println(“도형을 그린다.”); } } Class Polygon extends Figure{ public draw(){ System.out.println(“다각형을 그린다.”); } } Class Square extends Polygon{ public draw(){ System.out.println(“사각형을 그린다.”); } } Class Circle extends Figure{ public draw(){ System.out.println(“원을 그린다.”); } } 도형을 그린다. 다각형을 그린다. 사각형을 그린다. 원을 그린다.
  • 19. 객체지향 정리! 추상화 캡슐화 상속성 다형성 Private Public 사람 <– 학생 <- 교수 미묘하게 다른 함수들을 같은 이름으로 호출 Class (객체들의 공통적인 특징!) 4가지 특징