본문 바로가기

반응형

분류 전체보기

(127)
[Java] 클래스변수 package org.opentutorials.javatutorials.classinstance; class Calculator{ static double PI = 3.14; int left, right; public void setOperands(int left, int right) { this.left = left; this.right = right; } public void sum() { System.out.println(this.left + this.right); } public void avg() { System.out.println((this.left + this.right)/2); } } public class CalcuratorDemo2 { public static void main(Str..
[Java] 인스턴스, class package org.opentutorials.javatutorials.object; class Calculator{ int left, right; public void setOperands(int left, int right) { this.left = left; // this 는 4번째 줄 left 이다 this.right = right; // this 는 4번째 줄 right 이다 } public void sum() { System.out.println(this.left + this.right); } public void avg() { System.out.println((this.left + this.right)/2); } } public class CalculatorDemo { public stat..
[Java] 메소드 메소드 다른 말로 함수. 자바에서는 메소드라고 부르고, 다른 언어에서는 함수라고 불린다.
[Javascript] for in 더보기 var obj = { a: "사과", b: "배", c: "귤" } for(var i in obj) { console.log(i + ":" + obj[i]); } [출력값] a: 사과 b: 배 c: 귤
[Java] for-each package org.poentutorials.javatutorials.array; public class ForeachDemo { public static void main(String[] args) { String[] members = {"박보검", "송강", "정경호"}; for(String e : members) { System.out.println(e); } } } [출력값] 박보검 송강 정경호
[Java] 자바 문서 구글에 "api documentation java" 검색 docs.oracle.com/javase/7/docs/api/ Java Platform SE 7 docs.oracle.com 클래스 public class ClassApp { public static void main(String[] args) { System.out.println(Math.PI); //3.141592653589793 System.out.println(Math.floor(1.6)); //1.0 System.out.println(Math.ceil(1.6)); //2.0 } } 인스턴스 import java.io.FileNotFoundException; import java.io.IOException; import java.io.Pri..
[Java] 배열 package org.poentutorials.javatutorials.array; public class Array { public static void main(String[] args) { String[] classGroup = {"최진", "최유", "이고잉", "우니우"}; } } string의 배열을 가진다 package org.poentutorials.javatutorials.array; public class Array { public static void main(String[] args) { String[] classGroup = new String[4]; } } 자료형[] 변수 = new 자료형[배열크기]; package org.poentutorials.javatutorials.arr..
[Java] 데이터 타입 [정수형] byte = 1byte / 표현 가능 범위 : -128~127 short = 2byte / 표현 가능 범위 : -32,768 ~ 32,767 int = 4byte / 표현 가능 범위 : -2,147,483,648~2,147,483,647 long = 8byte / 표현 가능 범위 : -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 [실수형] float = 4byte / 표현 가능 범위 : ±(1.40129846432481707e-45 ~ 3.40282346638528860e+38) double = 8byte / 표현 가능 범위 : ±(4.94065645841246544e-324d ~ 1.79769313486231570e+308d) [문자형] c..
[Javascript] window.history.back(), history.forward(), history.go() -History.back() 브라우저가 세션 기록의 바로 뒤 페이지로 이동 history.go(-1)과 같다 HTML 뒤로 가기! JavaScript document.getElementById('go-back').addEventListener('click', () => { window.history.back(); }); -History.forward() 세션 기록의 바로 앞 페이지로 이동 history.go(1)과 같다 HTML 앞으로 가기! JavaScript document.getElementById('go-forward').addEventListener('click', e => { window.history.forward(); }) -History.go() 한페이지 뒤로가기 history.go(-1..
[Javascript] 즉시 실행 함수 (function(name){ console.log(name); //wooni })('wooni');

반응형