java 썸네일형 리스트형 spring java 파일 삭제 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.io.File; public class FileDeletionExample { public static void main(String[] args) { // 삭제할 파일 경로 String filePath = "C:\\example\\file.txt"; // File 객체 생성 File file = new File(filePath); // 파일이 존재하는지 확인 if (file.exists()) { // 파일 삭제 file.delete(); System.out.println("파일이 삭제되었습니다."); } else { System.out.println("파일이 존재하지 않습니다."); } } .. 더보기 [JAVA] 알고리즘-짝수와 홀수 //내가 만듬 java 짝수와 홀수public class EvenOrOdd { String evenOrOdd(int num) { String result = ""; if(num % 2 == 0){ result = "Even"; }else if(num % 2 == 1){ result = "Odd"; } return result; } public static void main(String[] args) { String str = "1 2 3 4"; EvenOrOdd evenOrOdd = new EvenOrOdd(); //아래는 테스트로 출력해 보기 위한 코드입니다. System.out.println("결과 : " + evenOrOdd.evenOrOdd(3)); System.out.println("결과 : ".. 더보기 [JAVA] 알고리즘-평균값구하기 //내가 만든 java 평균값 구하기public class GetMean { public int getMean(int[] array) { int sum = 0; int num = array.length; int avg = 0; for(int i = 0 ; i 더보기 이전 1 다음