U E D R , A S I H C RSS

Java Study2003/두번째과제/노수민

ToyProblem

~cpp 
public class factorial {
	public int process(int number)	{
		if(number!=1)
			return number*process(number-1);
		else return 1; 
	}
	public void main()	{
		System.out.println(process(7));
	}

}


  • RandomWork eclipse Run ;
    결과 .;
    Run ;; ; 결국 간


?


  • , ex) , , ..
    .
  • (state) : 객
  • (behavior) : 객
    ex) - , , , ,
    , ,

'객'.

  • ->
    .
    ,
    고 구.

<- OOP의 특징


  • : () () .
    ,,
    고, public private 권 .

  • : 객 .
    , 과 그 .

  • : ' ' .
    .
    고, .

  • : ' '고 고, .
    .

  • : - () -> , , 그, (객)

  • : , , ,
    , ,, , " "고 .

  • :
    () , .

(객)


.



~cpp 
class  {
   //  
      
   //  
      
}     



~cpp 
   = new ();



 ;

 = new ();

  • public - ,
  • private -
  • protected - ,
  • : ,








new .

  • , 객 ,
  • new , 고 객

~cpp 
( ) {  }

( ) {
  ;  ß     
 .
 
}

  = new ( );

===this===

*
* this
* 객
~cpp 
this

this.

this();


고,
.


~cpp 
    )

[근권] static  ;

[근권] static  ;

    근)

.()

()

객값.()










, ,



  • this :

  • super :


  • new 공간

  • 0, '\u0000', false, 그고 null







(Overriding)

.

, . 그고, , ,

.

  • .
  • .
  • .
  • 각각 .
  • .


  • , , 그 .

  • private 고, .

  • public protected 고, .


...
...
...




OOP


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:32
Processing time 0.0278 sec