728x90 반응형 Study364 [Java] 배열 거꾸로 하기 public String[] reverseArr(String[] arr) { List list = Arrays.asList(arr); Collections.reverse(list); return list.toArray(new String[list.size()]); } 2021. 2. 1. [Jquery] 라디오 버튼 체크 값 가져오기, 체크 여부 확인 상위와 같이 라디오 버튼을 구현 했을 때 jQuery를 이용하여 체크된 라디오 버튼의 값, 혹은 라디오 버튼의 체크 여부를 확인할 수 있다. var listVar = $('input[name=list]:checked').val(); 이렇게 하면 value에 설정한 값을 가져올 수 있다. 또한 라디오버튼, 체크박스의 체크 여부를 확인하기 위해서는 아래와 같이 사용하면 된다. var listVar = $('input[name=list]').is(":checked"); $('input:radio[name=이름]').is(":checked"); $('input:checkbox[name=이름]').is(":checked"); Reference : dkfkslsksh.tistory.com/31 2021. 2. 1. [Java] url 존재 여부 체크 URL url = new URL("파일이 있는 full Url"); URLConnection con = url.openConnection(); HttpURLConnection exitCode = (HttpURLConnection)con; exitCode.getResponseCode() == 200 : 파일존재 exitCode.getResponseCode() == 404 : 파일 존재하지 않음. kimddochi.tistory.com/11 2021. 1. 26. [Java] 오늘, 어제, 이번달, 올해, 지난해 등 날짜 구하기 오늘 날짜 구하기 Calendar cal = Calendar.getInstance(); String format = "yyyy-MM-dd"; SimpleDateFormat sdf = new SimpleDateFormat(format); String date = sdf.format(cal.getTime()); System.out.println(date); 어제 날짜 구하기 - Calendar.add() 메소드 활용 Calendar cal = Calendar.getInstance(); String format = "yyyy-MM-dd"; SimpleDateFormat sdf = new SimpleDateFormat(format); cal.add(cal.DATE, -1); //날짜를 하루 뺀다. String .. 2021. 1. 26. 이전 1 ··· 64 65 66 67 68 69 70 ··· 91 다음 728x90 반응형