본문 바로가기 메뉴 바로가기

InPro

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

InPro

검색하기 폼
  • 분류 전체보기 (232)
    • Programming (43)
      • ANDROID (5)
      • CSS (0)
      • HTML (1)
      • JAVA (12)
      • JAVASCRIPT (12)
      • JQUERY (5)
      • JSTL (0)
      • MYSQL (2)
      • PHP (1)
      • VUE (1)
    • 정보 (171)
    • 해몽 (15)
  • 방명록

Programming/JAVA (12)
자바 Java String to DateTime DateTime to String LocalDateTime 변환

자바 Java String to DateTime DateTime to String LocalDateTime 변환 public class DateTest { public static main(String[] args) throws ParseException { String dateTimeStr = "2022-07-20 09:30:25.123"; String dateFormatPattern = "yyyy-MM-dd HH:mm:ss"; // Date to String SimpleDateFormat dateFormat = new SimpleDateFormat(dateFormatPattern); Date date = dateFormat.parse(dateTimeStr); // Wed Jul 20 09:30:25 ..

Programming/JAVA 2022. 7. 20. 08:30
자바 Java String to LocalTime LocalTime to String 변환

자바 Java String to LocalTime LocalTime to String 변환 Stirng LocalTime 을 변환하기 위해서는 DateTimeFormatter를 사용하시면 됩니다. public class TimeTest { public static void main(String[] args) { String timeStr = "16:39:45"; DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss"); LocalTime time = LocalTime.parse(timeStr, formatter); System.out.println("time : " + time); // 16:39:45 time = time.plus(2,..

Programming/JAVA 2022. 7. 16. 08:47
자바 Java 소수점 올림 반올림 버림

자바 Java 소수점 올림 반올림 버림 올림 Math.ceil(num) 반올림 Math.round(num) 내림 Math.floor(num) public class MathTest { public static void main(String[] args) { // 올림 double ceil1 = Math.ceil(123); // 123 double ceil2 = Math.ceil(123.4); // 124 double ceil3 = Math.ceil(123.45); // 124 System.out.println("ceil1 : " + ceil1); System.out.println("ceil2 : " + ceil2); System.out.println("ceil3 : " + ceil3); // 반올림 do..

Programming/JAVA 2022. 7. 15. 08:56
Java 자바 소수점 자르기

Java 자바 소수점 자르기 public class Demical { public static main(String[] args) { double num = 123.456789; DecimalFormat df = new DecimalFormat("0"); System.out.println(df.format(num)); // 123 df = new DecimalFormat("0.0"); System.out.println(df.format(num)); // 123.5 df = new DecimalFormat("0.00"); System.out.println(df.format(num)); // 123.46 String str = String.format("%.0f", num); // 123 System.out..

Programming/JAVA 2022. 7. 13. 08:37
자바 깊은 복사(Deep Copy) 얕은 복사(Shallow Copy) 비교

자바 깊은 복사(Deep Copy) 얕은 복사(Shallow Copy) 비교 코딩을 하다보면 깊은복사 얕은복사에 대한 내용은 많이 접하셨을 겁니다. 간단하고 기본적인 내용이지만 종종 헷갈린 경우도 있을건데요. 오늘은 깊은 복사 얕은복사에 차이에 대해서 알아보겠습니다. 깊은복사 객체를 복사시 객체가 가지고 있는 값을 새로운 메모리에 복사합니다. 얕은복사 객체를 복사시 객체가 가지고 있는 값을 복사하는 것이 아니라 객체의 주소값을 복사합니다. public class CopyObject implements Cloneable { private String name; private int age; private LocalDate birth; public CopyObject(String name, int age, ..

Programming/JAVA 2022. 6. 28. 08:49
자바 최대값 최소값 구하기

자바 최대값 최소값 구하기 public class MaxAndMin { public static void main(String[] args) { Integer numbers = {2, 5, 10, 29, 22}; // for문 // 최대값 int maxValue = numbers[0]; for (int value : numbers) { if (value > maxValue) { maxValue = value; } } System.out.println("maxValue1 : " + maxValue); // 최소값 int minValue = numbers[0]; for (int value : numbers) { if (value < minValue) { minValue = value; } } System.o..

Programming/JAVA 2022. 6. 27. 08:33
자바 문자열 숫자인지 확인

자바 문자열이 숫자인지 확인하기 Double.parseDouble public class NumbericYn { public static void main(String[] args) { String str = &#39;123.0&#39;; boolean numberYn = parseDouble(str); System.out.println(numberYn); } public static boolean numbericYn(String str) { try { Double.parseDouble(str); return true; } catch (NumberFormatException ex) { return false; } } } Apache Commons Lang public class NumbericYn { p..

Programming/JAVA 2022. 6. 25. 08:57
[Java] 자바 배열, 리스트 랜덤으로 섞기 random shuffle

자바 배열 리스트 랜덤으로 섞기 shuffle Collections의 shuffle을 이용해서 배열, 리스트를 섞는 방법입니다. public class Shuffle { public static void main(String[] args) { Integer[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; List numberList = Arrays.asList(numbers); // 기본값 System.out.println(Arrays.toString(numbers); Collections.shuffle(numberList); // 변경값 System.out.println(Arrays.toString(numbers); } } 결과 [1, 2, 3, 4, 5, 6, 7, 8, ..

Programming/JAVA 2022. 6. 22. 07:59
자바 Boolean 정렬 Boolean.compare

Boolean 정렬 Boolean.compare System.out.println(Boolean.compare(true, true); System.out.println(Boolean.compare(false, false); System.out.println(Boolean.compare(true, false); System.out.println(Boolean.compare(false, true); 결과 0 0 1 -1 Boolean.compare(x, y) x == y 인 경우 0을 리턴합니다. x가 true, y가 false면 -1를 리턴합니다. x가 false, y가 true면 1를 리턴합니다.

Programming/JAVA 2021. 4. 7. 18:01
자바 map 다중제거 Iterator

자바 map 다중제거 Iterator Map map = new HashMap(); map.put(1, 11); map.put(2, 22); // 1번 for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Map.Entry entry = it.next(); if (entry.getKey() > 0) { // 제거 it.remove(); } } // 2번 map.entrySet().removeIf(e -> { return e.getKey() > 0; }); // 2번 요약 map.entrySet().removeIf(e -> e.getKey() > 0); // 3번 Iterator it = map.keySet().iterator(); while(it...

Programming/JAVA 2021. 4. 6. 18:58
이전 1 2 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 자바 정렬
  • Java String 변환
  • 근로소득원천징수영수증
  • 자바 String 변환
  • 자바
  • 자바 LocalDateTime 변환
  • nginx Request Entity Too Large
  • 자바 Date 변환
  • 자바스크립트 time to seconds
  • Java Date 변환
  • 구글
  • 자바 소수점
  • 크린토피아
  • 우체국
  • 신한카드
  • 여권
  • nginx client_max_body_size
  • nginx 파일 업로드 크기
  • 안드로이드
  • 핸드폰
  • 정렬
  • 휴면계좌
  • Javascript time to seconds
  • 근로소득원천징수영수증 발급
  • 국민연금
  • 아이폰
  • Java LocalDateTime 변환
  • 실업급여
  • 크린토피아 가격표
  • 근로소득원천징수영수증 발급 방법
more
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바