Java(159)
-
STS4 javascript 메뉴가 보이지 않는 경우
참조: https://www.egovframe.go.kr/home/qainfo/qainfoRead.do?pagerOffset=0&searchKey=&searchValue=&menuNo=69&qaId=QA_00000000000020192 묻고 답하기 | 표준프레임워크 포털 eGovFrame처리중입니다. 잠시만 기다려주십시오.www.egovframe.go.krjavascript 메뉴가 제대로 지원이 안되서 발생한 문제Help > Install New Software 추가: http://download.eclipse.org/releases/photon 선택: [Web, XML, Java EE ~~] > [JavaScript Development Tools] 재기동
2024.11.30 -
Java String[]에서 ""를 찾아내기
기본public class FindEmptyString { public static void main(String[] args) { String[] array = {"Hello", "World", "", "Java"}; boolean hasEmptyString = false; for (String str : array) { if ("".equals(str)) { // Check for an empty string hasEmptyString = true; break; // Exit the loop as we found an empty string } } ..
2024.11.30 -
Java java.util.ConcurrentModificationException 처리
Collection(List, Set, Map 등)을 반복중에 구조적 변경을 할 경우, 예외가 발생함예외 발생 예// 순환하는 중에 요소 등록하는 경우import java.util.ArrayList;import java.util.Iterator;public class ConcurrentModificationDemo { public static void main(String[] args) { ArrayList list = new ArrayList(); list.add("A"); list.add("B"); list.add("C"); for (String item : list) { if ("B".equals(item)) {..
2024.11.30 -
Java Exception에 변수 추가하기
class SpecialValueException extends Exception { private final int specialValue; public SpecialValueException(String message, int specialValue) { super(message); this.specialValue = specialValue; } public int getSpecialValue() { return specialValue; }}public class CustomExceptionExample { public static void main(String[] args) { try { proce..
2024.11.30 -
Java Directory 존재여부 체크 및 생성
File의 exists(), isDirectory() 사용import java.io.File;public class DirectoryCheck { public static void main(String[] args) { // Specify the directory path String directoryPath = "/path/to/directory"; // Create a File object for the specified path File directory = new File(directoryPath); // Check if the path exists and is a directory if (directory.exist..
2024.11.30 -
Mybatis if ~ else 적용하기
사용 SELECT * FROM users WHERE 1=1 AND name = #{name} AND age = #{age} AND status = 'active' 사용 SELECT * FROM users name = #{name} age = #{age} 응용 SELECT * FROM users name = #{name} ..
2024.11.27