Java ☕️

아래와 같이 인자값을 받으면 그에 맞는 구구단을 출력하는 파일을 생성하는 프로그램을 짜보자java Gugudan 3단import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;public class Gugudan { public static void main(String[] args) { // TODO Auto-generated method stub FileOutputStream fos = null; try { fos = new FileOutputStream("./" + args[0] + ".txt"); int dan = Integer.parseInt(args[0].r..
import java.util.Calendar;public class CalendarEx04 { public static void main(String[] args) { // TODO Auto-generated method stub // 현재달의 달력 int year = 2024; int month = 5; // 달력 출력 Calendar startCalendar = Calendar.getInstance(); Calendar endCalendar = Calendar.getInstance(); startCalendar.set(year, month-1, 1); endCalendar.set(year, month, 1-1); int startDayOfWeek = startCale..
· Java ☕️
1. 먼저 아래 페이지에 접속 뒤 Download라고 적힌 주황색 버튼 누르기https://www.eclipse.org/ The Community for Open Collaboration and Innovation | The Eclipse FoundationThe Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …www.eclipse.org 2. 아래 페이지에서 Download Packages 클릭 3. java를 이용해 웹을 만들것이기 때문에 Eclise IDE for En..
· Java ☕️
먼저 Visual studio에서 아래와 같은 HelloWorld.java파일을 만든다public class HelloWorld { public static void main(String[] args) { // 프로그램 시작 // 연결해서 출력 System.out.print("Hello"); System.out.print("안녕"); System.out.println("Hello"); System.out.println("안녕"); // %n \n - 엔터키, \t 탭키 System.out.printf("[%s]%n", "Hello"); System.out.printf("[%..
char배열을 String클래스로 변환하거나, 또는 그 반대로 변환해야 하는 경우, 아래의 코드를 사용하자 char[] chArr = {'A', 'B', 'C'}; String str = new String(chArr); // char배열 -> String char[] tmp = str.toCharArray(); // String -> char배열
char 배열을 문자열로 변환하는 방법에는 여러 가지가 있습니다. 여기에는 몇 가지 일반적인 방법이 포함됩니다 1. String 생성자 사용: String 클래스의 생성자 중 하나는 char 배열을 받아들일 수 있습니다. char[] charArray = {'H', 'e', 'l', 'l', 'o'}; String str = new String(charArray); System.out.println(str); // 출력: Hello 2. String의 valueOf() 메서드 사용: String 클래스의 valueOf() 메서드를 사용하여 char 배열을 문자열로 변환할 수도 있습니다. char[] charArray = {'H', 'e', 'l', 'l', 'o'}; String str = String...