package demo.properties;
import java.io.FileReader;
import java.util.Properties;
public class PropertiesDemo {
public static void main(String[] args) throws Exception {
Properties prop = new Properties();
FileReader reader = new FileReader("src/demo/properties/config.properties");
// void load(Reader reader)
// FileReader객체를 사용해서 파일의 정보를 읽어온다.
prop.load(reader);
// String getProperty(String key)
// 프로퍼티 파일에서 지정된 키값으로 설정된 값을 반환한다.
String value1 = prop.getProperty("user.name");
System.out.println(value1);
String value4 = prop.getProperty("select.users");
System.out.println(value4);
}
}
package demo.etc;
import java.util.LinkedList;
public class QueueDemo {
public static void main(String[] args) {
LinkedList<String> queue = new LinkedList<String>();
queue.offer("홍길동");
queue.offer("김유신");
queue.offer("강감찬");
queue.offer("이순신");
String value1 = queue.poll();
System.out.println(value1);
System.out.println("현재 개수 : " + queue.size());
String value2 = queue.poll();
System.out.println(value2);
System.out.println("현재 개수 : " + queue.size());
}
}
package demo.etc;
import java.util.Stack;
public class StackDemo {
public static void main(String[] args) {
Stack<String> stack = new Stack<String>();
stack.push("홍길동");
stack.push("김유신");
stack.push("강감찬");
stack.push("이순신");
String value1 = stack.pop();
System.out.println(value1);
System.out.println("현재 개수 : " + stack.size());
String value2 = stack.pop();
System.out.println(value2);
System.out.println("현재 개수 : " + stack.size());
}
}
sort (0) |
2019.06.10 |
set (0) |
2019.06.10 |
map (0) |
2019.06.10 |
list (0) |
2019.06.10 |