피드로 돌아가기
새로워지기·서른의 생활코딩

ex16) java _ 문의

NS
normalstory
표지 이미지


// ( 예제를 왜 이렇게 만들었는지 모르겠다. -_-)


1.

/* my 함수예제 01
public class Function {

        static void sub(){ 
                // void=결과형 (결과치를 반환(=호출받기전엔!)하지않는다!)
                // sub=함수명(사용자정의)
                // () 안에 매개변수를 넣을 수 있다. !!!
                // 1. sub()를 객체로 만들어 호출하던가
                //      (즉 = 객체를 new연산자로 정의하고 object명으로 접근하던가
                // 2. "static 맴버함수"로 선언 필요! (println는 메이커가 제공)
                System.out.println("SUB 함수안 +" + a);
}

public static void main(String[] args) {

        System.out.println("Main 함수처음");
        int a=3;
        sub(); // sub=함수명(사용자정의)
                  // 호출한다 = ()
                  // () 안에 매개변수를 넣을 수 있다. !!!
        System.out.println("Main 함수끝");
        }
}
**/



// my 함수예제 01
public class Function {
        static void sub(){ 
                System.out.println("SUB 함수안 ");
        }

        public class Fun03{
                public void main(String[] args) {
                        Function.sub();
                        //Function t = new Function();
                        //t.sub();
                }
        }
}
//  class.으로 접근하는게 원칙이다.







2

/*
//import java.io.IOException;


//입력받아 출력하는(=메인함수) 함수 처리
//계산=함수

class Test07{
void Fat(int In){
int i;
for(i=0;i<=In;i++){
System.out.print(In+"*");
}
}
}


public class Fun07 {
public static void main(String[] args) throws IOException {
System.out.print("숫자입력하세요: ");

System.in.read(); //IO pakage
Test07 t = new Test07();
t.Fat(a);
}
}
**/

class Test07{
int Fat(int g){
// 값을 받는 다는 것은 변수의 특성이므로 함수명 앞에 반드시 자료형이 기재되어있어야한다.
// 따라서 값을 저장할 수는 있지만!!!
// 값을 받는 다는 것은 변수의 특성이나 대입연산자(=)를 이용하여 임의의 값을 할당할 순없다.

int f=1; //누적을 위해,초기화 필요 단,!=0
for(int i=g; i>=1;i--){
f=f*i;
}
return f;   // 1개의 값만 기재가 가능하다.
   // 리턴 명령어로 반환시켜주는 값은 함수명으로 저장하여 되돌려준다.
   // 대입=X 초기화개념=0
//= return(f);   
}
}

public class Fun07 {
public static void main(String s[]){
int Gab = Integer.parseInt(s[0]); 
//Integer=class /parseInt=스태틱변수
Test07 t10 =new Test07(); //객체 선언!!!
//t10.Fat(Gab);
int gg= t10.Fat(Gab);
System.out.println("5!= "+gg);
}

}

 

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
친절한 찰쓰씨
글쓴이
친절한 찰쓰씨
친절한 찰쓰씨 · 일상 UX 디자이너
기획·디자인·단상을 조용히 기록합니다.
작가 페이지에서 더 보기

이어서 읽기

새로워지기

꾸준히, 오래, 지치지 않고

Mar 31, 2026·8
새로워지기

테크 라이프 발란스

Feb 7, 2026·3
새로워지기

휴탈리티 박정렬

Feb 7, 2026·11