SlideShare uma empresa Scribd logo
1 de 11
Java Standard(8~13)

10조 이용진, 이충만, 박노식
8. 삼항연산자


Return a>0 ? True : false;
9. For문
• For(초기값; 조건 ; 스텝)}{
 …..
 }
10. while
• While(조건문){
• …..
• }
11. 기본타입 참조타입
• 기본타입
  – Pass(assign) by value, immutable(불변)
  – public void make(int a)란 메소드가 있을때 make(2); 처럼 값을 넣
    어서 메서드를 사용하는것은 패스바이밸류다.
  – int a = 1; 이라고 했을 때 'a'가 바뀌지 않기 때문에 이것을
    immutable이라 한다.

• 참조타입
  – arr = [a][b][c] , arr[0] = d;는 주소값의 의한 변경.
  – API, User Define, Array
12. Method #1
public static void Main(String[] args){
…}

•   public : 접근 제한자.
•   ■ public : 어디서든지 접근가능. (UML에서는 + 로 사용한다)
•   ■ protected : 상속을 하면 public, 상속을 안하면 private (UML : #)
•   ■ private : 자기 class내에서만 public으로 사용 (UML : -)
•   ■ default : 아무것도 안쓸때 사용됨
    – protected와 비슷하지만 하위class에서 사용불가. (아무것도 안적음)
13. Method #2
•   static : 주소값을 가지냐 가지고 있지않은가?
•   ■ Non-static :
•   ■ static : 메인메서드는 시작과 끝이기 때문에
•   # B b = new B()를 사용하지 않고도, 즉 객체를 생성하지 않고 B클래스내에
    있는 public static void print() 메서드를 사용할 수 있다. - 이것은 어떤 객체를
    생성시킬 필요가 없다.
•

•   # public void print()로 메서드를 생성시켰을 때는 new로 주소를 할당하고 인
    스턴스를 생성해야 메서드가 사용가능하다.
•

•   # 규칙
•   static -> static
•   static -x-> public
•   non-static -> static
•   non-static -x-> non-static
12. Method #3
•   void : 리턴타입
•   return isc == 1 ? true, false
•   클래스도 리턴타입이 될 수 있다.
•   public B isLeafYear(int n){
•   B b;
•   if(n=1){ b = new B();
•   return B;}
•   }
12. Method #4
• String[] arg : 매개변수(parameter)
  – Int myMethod(String str){ …. }


• public void LeafYear(int i)에서 int i는
  argment(호출시의 인수 )
  – String buf = “hi”;
  – String temp = mymethod(buf);
13. Strnig #1
•   참조 타입, Concatenation
•
    String str = "가"
•   String str2 = "나"
•   String msg = str + str2;

•   String + 기본타입 = String (Concatenation)

•   string 11
•   첫번째 숫자를 charAt()은char배열로 바꿔준다.
•   substring, split, tokenizer

•   str = "대한민국"
•   substring(str, 0,3)
•   결과값 : "대한민"
•   char c = str.charAt(0);
13. String #2
•   charAt
•   public char charAt(int index)
•   Returns the char value at the specified index. An index ranges from 0 to length() - 1. The first char value of the
    sequence is at index 0, the next at index 1, and so on, as for array indexing.If the char value specified by the index
    is a surrogate, the surrogate value is returned.
•   Specified by:charAt in interface CharSequence
•   Parameters:index - the index of the char value.
•   Returns:the char value at the specified index of this string. The first char value is at index 0.
•   Throws:IndexOutOfBoundsException - if the index argument is negative or not less than the length of this string.



•   String substring(int beginIndex)
          Returns a new string that is a substring of this string.
•   String substring(int beginIndex, int endIndex)
          Returns a new string that is a substring of this string.

Mais conteúdo relacionado

Mais procurados

7 mid term summary
7 mid term summary7 mid term summary
7 mid term summary웅식 전
 
Haskell study 12
Haskell study 12Haskell study 12
Haskell study 12Nam Hyeonuk
 
2015 Kitel C 언어 강좌3
2015 Kitel C 언어 강좌32015 Kitel C 언어 강좌3
2015 Kitel C 언어 강좌3ssuseraf62e91
 
Haskell study 15
Haskell study 15Haskell study 15
Haskell study 15Nam Hyeonuk
 
Template at c++
Template at c++Template at c++
Template at c++Lusain Kim
 
The C++ Programming Language 5장 포인터, 배열, 구조체
The C++ Programming Language 5장 포인터, 배열, 구조체The C++ Programming Language 5장 포인터, 배열, 구조체
The C++ Programming Language 5장 포인터, 배열, 구조체해강
 
[C++ Korea] Effective Modern C++ MVA item 9 Prefer alias declarations to type...
[C++ Korea] Effective Modern C++ MVA item 9 Prefer alias declarations to type...[C++ Korea] Effective Modern C++ MVA item 9 Prefer alias declarations to type...
[C++ Korea] Effective Modern C++ MVA item 9 Prefer alias declarations to type...Seok-joon Yun
 
Haskell study 14
Haskell study 14Haskell study 14
Haskell study 14Nam Hyeonuk
 
Start IoT with JavaScript - 5.객체2
Start IoT with JavaScript - 5.객체2Start IoT with JavaScript - 5.객체2
Start IoT with JavaScript - 5.객체2Park Jonggun
 
파이썬 숫자,변수,문자열
파이썬 숫자,변수,문자열파이썬 숫자,변수,문자열
파이썬 숫자,변수,문자열HoYong Na
 
[C++ Korea] Effective Modern C++ MVA item 8 Prefer nullptr to 0 and null +윤석준
[C++ Korea] Effective Modern C++ MVA item 8 Prefer nullptr to 0 and null +윤석준[C++ Korea] Effective Modern C++ MVA item 8 Prefer nullptr to 0 and null +윤석준
[C++ Korea] Effective Modern C++ MVA item 8 Prefer nullptr to 0 and null +윤석준Seok-joon Yun
 
Effective Modern C++ MVA item 18 Use std::unique_ptr for exclusive-ownership ...
Effective Modern C++ MVA item 18 Use std::unique_ptr for exclusive-ownership ...Effective Modern C++ MVA item 18 Use std::unique_ptr for exclusive-ownership ...
Effective Modern C++ MVA item 18 Use std::unique_ptr for exclusive-ownership ...Seok-joon Yun
 
포인터의 기초(1)
포인터의 기초(1)포인터의 기초(1)
포인터의 기초(1)Hoyoung Jung
 
포인터의기초 (2) - 포인터 사용하기1
포인터의기초 (2) - 포인터 사용하기1포인터의기초 (2) - 포인터 사용하기1
포인터의기초 (2) - 포인터 사용하기1Hoyoung Jung
 

Mais procurados (20)

7 mid term summary
7 mid term summary7 mid term summary
7 mid term summary
 
Haskell study 12
Haskell study 12Haskell study 12
Haskell study 12
 
2015 Kitel C 언어 강좌3
2015 Kitel C 언어 강좌32015 Kitel C 언어 강좌3
2015 Kitel C 언어 강좌3
 
Haskell study 7
Haskell study 7Haskell study 7
Haskell study 7
 
Haskell study 15
Haskell study 15Haskell study 15
Haskell study 15
 
Template at c++
Template at c++Template at c++
Template at c++
 
The C++ Programming Language 5장 포인터, 배열, 구조체
The C++ Programming Language 5장 포인터, 배열, 구조체The C++ Programming Language 5장 포인터, 배열, 구조체
The C++ Programming Language 5장 포인터, 배열, 구조체
 
C review
C  reviewC  review
C review
 
3.포인터
3.포인터3.포인터
3.포인터
 
[C++ Korea] Effective Modern C++ MVA item 9 Prefer alias declarations to type...
[C++ Korea] Effective Modern C++ MVA item 9 Prefer alias declarations to type...[C++ Korea] Effective Modern C++ MVA item 9 Prefer alias declarations to type...
[C++ Korea] Effective Modern C++ MVA item 9 Prefer alias declarations to type...
 
Haskell study 14
Haskell study 14Haskell study 14
Haskell study 14
 
Start IoT with JavaScript - 5.객체2
Start IoT with JavaScript - 5.객체2Start IoT with JavaScript - 5.객체2
Start IoT with JavaScript - 5.객체2
 
Haskell study 9
Haskell study 9Haskell study 9
Haskell study 9
 
Haskell study 4
Haskell study 4Haskell study 4
Haskell study 4
 
Go
GoGo
Go
 
파이썬 숫자,변수,문자열
파이썬 숫자,변수,문자열파이썬 숫자,변수,문자열
파이썬 숫자,변수,문자열
 
[C++ Korea] Effective Modern C++ MVA item 8 Prefer nullptr to 0 and null +윤석준
[C++ Korea] Effective Modern C++ MVA item 8 Prefer nullptr to 0 and null +윤석준[C++ Korea] Effective Modern C++ MVA item 8 Prefer nullptr to 0 and null +윤석준
[C++ Korea] Effective Modern C++ MVA item 8 Prefer nullptr to 0 and null +윤석준
 
Effective Modern C++ MVA item 18 Use std::unique_ptr for exclusive-ownership ...
Effective Modern C++ MVA item 18 Use std::unique_ptr for exclusive-ownership ...Effective Modern C++ MVA item 18 Use std::unique_ptr for exclusive-ownership ...
Effective Modern C++ MVA item 18 Use std::unique_ptr for exclusive-ownership ...
 
포인터의 기초(1)
포인터의 기초(1)포인터의 기초(1)
포인터의 기초(1)
 
포인터의기초 (2) - 포인터 사용하기1
포인터의기초 (2) - 포인터 사용하기1포인터의기초 (2) - 포인터 사용하기1
포인터의기초 (2) - 포인터 사용하기1
 

Semelhante a Java standard(8~13)

Let's Go (golang)
Let's Go (golang)Let's Go (golang)
Let's Go (golang)상욱 송
 
Python programming for Bioinformatics
Python programming for BioinformaticsPython programming for Bioinformatics
Python programming for BioinformaticsHyungyong Kim
 
Java_02 변수자료형
Java_02 변수자료형Java_02 변수자료형
Java_02 변수자료형Hong Hyo Sang
 
Java 변수자료형
Java 변수자료형Java 변수자료형
Java 변수자료형Hyosang Hong
 
2013 C++ Study For Students #1
2013 C++ Study For Students #12013 C++ Study For Students #1
2013 C++ Study For Students #1Chris Ohk
 
나에 첫번째 자바8 람다식 지앤선
나에 첫번째 자바8 람다식   지앤선나에 첫번째 자바8 람다식   지앤선
나에 첫번째 자바8 람다식 지앤선daewon jeong
 
[NDC2016] TERA 서버의 Modern C++ 활용기
[NDC2016] TERA 서버의 Modern C++ 활용기[NDC2016] TERA 서버의 Modern C++ 활용기
[NDC2016] TERA 서버의 Modern C++ 활용기Sang Heon Lee
 
NHNNEXT 개경프14 Subway Rocket Team Study 3rd C++
NHNNEXT 개경프14 Subway Rocket Team Study 3rd C++NHNNEXT 개경프14 Subway Rocket Team Study 3rd C++
NHNNEXT 개경프14 Subway Rocket Team Study 3rd C++Min-soo Park
 
Python+numpy pandas 1편
Python+numpy pandas 1편Python+numpy pandas 1편
Python+numpy pandas 1편Yong Joon Moon
 
안드로이드 설계코드 노하우 및 개발방법
안드로이드 설계코드 노하우 및 개발방법안드로이드 설계코드 노하우 및 개발방법
안드로이드 설계코드 노하우 및 개발방법mosaicnet
 
5장 객체와클래스
5장 객체와클래스5장 객체와클래스
5장 객체와클래스SeoYeong
 
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)JiandSon
 
파이썬 스터디 9장
파이썬 스터디 9장파이썬 스터디 9장
파이썬 스터디 9장SeongHyun Ahn
 
Api design for c++ 6장
Api design for c++ 6장Api design for c++ 6장
Api design for c++ 6장Ji Hun Kim
 

Semelhante a Java standard(8~13) (20)

Let's Go (golang)
Let's Go (golang)Let's Go (golang)
Let's Go (golang)
 
Python programming for Bioinformatics
Python programming for BioinformaticsPython programming for Bioinformatics
Python programming for Bioinformatics
 
Java_02 변수자료형
Java_02 변수자료형Java_02 변수자료형
Java_02 변수자료형
 
Java 변수자료형
Java 변수자료형Java 변수자료형
Java 변수자료형
 
2013 C++ Study For Students #1
2013 C++ Study For Students #12013 C++ Study For Students #1
2013 C++ Study For Students #1
 
나에 첫번째 자바8 람다식 지앤선
나에 첫번째 자바8 람다식   지앤선나에 첫번째 자바8 람다식   지앤선
나에 첫번째 자바8 람다식 지앤선
 
6 function
6 function6 function
6 function
 
4. stack
4. stack4. stack
4. stack
 
[NDC2016] TERA 서버의 Modern C++ 활용기
[NDC2016] TERA 서버의 Modern C++ 활용기[NDC2016] TERA 서버의 Modern C++ 활용기
[NDC2016] TERA 서버의 Modern C++ 활용기
 
NHNNEXT 개경프14 Subway Rocket Team Study 3rd C++
NHNNEXT 개경프14 Subway Rocket Team Study 3rd C++NHNNEXT 개경프14 Subway Rocket Team Study 3rd C++
NHNNEXT 개경프14 Subway Rocket Team Study 3rd C++
 
06장 함수
06장 함수06장 함수
06장 함수
 
Python+numpy pandas 1편
Python+numpy pandas 1편Python+numpy pandas 1편
Python+numpy pandas 1편
 
강의자료4
강의자료4강의자료4
강의자료4
 
안드로이드 설계코드 노하우 및 개발방법
안드로이드 설계코드 노하우 및 개발방법안드로이드 설계코드 노하우 및 개발방법
안드로이드 설계코드 노하우 및 개발방법
 
5장 객체와클래스
5장 객체와클래스5장 객체와클래스
5장 객체와클래스
 
강의자료3
강의자료3강의자료3
강의자료3
 
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)
 
C++에서 Objective-C까지
C++에서 Objective-C까지C++에서 Objective-C까지
C++에서 Objective-C까지
 
파이썬 스터디 9장
파이썬 스터디 9장파이썬 스터디 9장
파이썬 스터디 9장
 
Api design for c++ 6장
Api design for c++ 6장Api design for c++ 6장
Api design for c++ 6장
 

Java standard(8~13)

  • 3. 9. For문 • For(초기값; 조건 ; 스텝)}{ ….. }
  • 5. 11. 기본타입 참조타입 • 기본타입 – Pass(assign) by value, immutable(불변) – public void make(int a)란 메소드가 있을때 make(2); 처럼 값을 넣 어서 메서드를 사용하는것은 패스바이밸류다. – int a = 1; 이라고 했을 때 'a'가 바뀌지 않기 때문에 이것을 immutable이라 한다. • 참조타입 – arr = [a][b][c] , arr[0] = d;는 주소값의 의한 변경. – API, User Define, Array
  • 6. 12. Method #1 public static void Main(String[] args){ …} • public : 접근 제한자. • ■ public : 어디서든지 접근가능. (UML에서는 + 로 사용한다) • ■ protected : 상속을 하면 public, 상속을 안하면 private (UML : #) • ■ private : 자기 class내에서만 public으로 사용 (UML : -) • ■ default : 아무것도 안쓸때 사용됨 – protected와 비슷하지만 하위class에서 사용불가. (아무것도 안적음)
  • 7. 13. Method #2 • static : 주소값을 가지냐 가지고 있지않은가? • ■ Non-static : • ■ static : 메인메서드는 시작과 끝이기 때문에 • # B b = new B()를 사용하지 않고도, 즉 객체를 생성하지 않고 B클래스내에 있는 public static void print() 메서드를 사용할 수 있다. - 이것은 어떤 객체를 생성시킬 필요가 없다. • • # public void print()로 메서드를 생성시켰을 때는 new로 주소를 할당하고 인 스턴스를 생성해야 메서드가 사용가능하다. • • # 규칙 • static -> static • static -x-> public • non-static -> static • non-static -x-> non-static
  • 8. 12. Method #3 • void : 리턴타입 • return isc == 1 ? true, false • 클래스도 리턴타입이 될 수 있다. • public B isLeafYear(int n){ • B b; • if(n=1){ b = new B(); • return B;} • }
  • 9. 12. Method #4 • String[] arg : 매개변수(parameter) – Int myMethod(String str){ …. } • public void LeafYear(int i)에서 int i는 argment(호출시의 인수 ) – String buf = “hi”; – String temp = mymethod(buf);
  • 10. 13. Strnig #1 • 참조 타입, Concatenation • String str = "가" • String str2 = "나" • String msg = str + str2; • String + 기본타입 = String (Concatenation) • string 11 • 첫번째 숫자를 charAt()은char배열로 바꿔준다. • substring, split, tokenizer • str = "대한민국" • substring(str, 0,3) • 결과값 : "대한민" • char c = str.charAt(0);
  • 11. 13. String #2 • charAt • public char charAt(int index) • Returns the char value at the specified index. An index ranges from 0 to length() - 1. The first char value of the sequence is at index 0, the next at index 1, and so on, as for array indexing.If the char value specified by the index is a surrogate, the surrogate value is returned. • Specified by:charAt in interface CharSequence • Parameters:index - the index of the char value. • Returns:the char value at the specified index of this string. The first char value is at index 0. • Throws:IndexOutOfBoundsException - if the index argument is negative or not less than the length of this string. • String substring(int beginIndex) Returns a new string that is a substring of this string. • String substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string.