Java (2) 썸네일형 리스트형 [Java] 자료구조 (Data Structures) 1. Array Syntax // Declaring and Creating Arrays int[] nums = new int[3]; double[] dubs = {1.0, 2.0, 3.0, 4.0, 5.0}; String[] str = {"Hello", , "world!"}; int[][] arr = new int[2][5]; // length of array int ln = nums.length; Example // foreach loops public class TestArray { public static void main(String[] args) { double[] arrList = {2.0, 3.3, 5.5, 7.1}; // Print all the array elements for (doub.. [Java] 자바 형 변환 예제 (Type Cast Examples) int to String String str = Integer.toString(i); String str = "" + i; String to int int i = Integer.parseInt(str); int i = Integer.valueOf(str).intValue(); double to String String str = Double.toString(d); long to String String str = Long.toString(l); float to String String str = Float.toString(f); String to double double d = Double.valueOf(str).doubleValue(); String to long long l = Long.valueOf.. 이전 1 다음