← Back to feed
Renewal·서른의 생활코딩

Ex22) Java OOP

NS
normalstory
cover image





class TestAA
{
int i;
TestAA(int a){
i = a;
}
public String toString(){
return "i member variable의 값은 : " + i + "이다."; //this.i=i
}
}

public class Num03 {
public static void main(String[] args) {
TestAA t1 = new TestAA(10);
TestAA t2 = new TestAA(20);
System.out.println(t1);
System.out.println(t2);
}
}











class Test1 implements Cloneable {
int a,b;
Test1(int a, int b){
this.a = a;
this.b = b;
}
public String toString(){          //type일치:String
return ("a=" + a + " " + "b=" + b);
}
public Test1 boksa(){
Object obj = null;
try {
obj = clone();       //this.clone()
} catch(CloneNotSupportedException e){}  
           //Exception는 try catch 블럭을 통해서만 call possible하다.
                                                   // (exception handling 위해만든 function!)
return (Test1)obj; //cast
}
}

public class Num04 {
public static void main(String[] args) {
Test1 t = new Test1(10,20);
Test1 b = t.boksa();
System.out.println(t);
System.out.println(b);

System.out.println(t.toString());    //=
System.out.println(b.toString());    //=
}
} 
  • Open in Google Docs Viewer
  • Open link in new tab
  • Open link in new window
  • Open link in new incognito window
  • Download file
  • Copy link address
  • Edit PDF File on PDFescape.com

element

Font
font-family
font-size
font-style
font-variant
font-weight
letter-spacing
line-height
text-decoration
text-align
text-indent
text-transform
white-space
word-spacing
color
Background
bg-attachment
bg-color
bg-image
bg-position
bg-repeat
Box
width
height
border-top
border-right
border-bottom
border-left
margin
padding
max-height
min-height
max-width
min-width
outline-color
outline-style
outline-width
Positioning
position
top
bottom
right
left
float
display
clear
z-index
List
list-style-image
list-style-type
list-style-position
Table
vertical-align
border-collapse
border-spacing
caption-side
empty-cells
table-layout
Effects
text-shadow
-webkit-box-shadow
border-radius
Other
overflow
cursor
visibility

This English version was translated by Claude.

친절한 찰쓰씨
Written by
친절한 찰쓰씨

Pleasant Charles — UI/UX researcher at AIT. Keeping notes on design, planning, and slow days here since 2010.