www.w3schools.com/java/java_class_methods.asp
스태틱은 오브젝트의 생성과 상관없이 접근가능함.
www.w3schools.com/java/java_modifiers.asp
Date & time 은 별로 필요없을것 같긴하지만..
www.w3schools.com/java/java_date.asp
www.w3schools.com/java/java_arraylist.asp
c++의 벡터와 차이점이 뭐지?
정렬은
ArrayList<String> cars = new ArrayList<String>();
cars.add("Volvo");
Collections.sort(cars);
www.w3schools.com/java/java_linkedlist.asp
The LinkedList class is a collection which can contain many objects of the same type, just like the ArrayList.
The LinkedList class has all of the same methods as the ArrayList class because they both implement the List interface. This means that you can add items, change items, remove items and clear the list in the same way.
However, while the ArrayList class and the LinkedList class can be used in the same way, they are built very differently.
The ArrayList class has a regular array inside it. When an element is added, it is placed into the array. If the array is not big enough, a new, larger array is created to replace the old one and the old one is removed.
The LinkedList stores its items in "containers." The list has a link to the first container and each container has a link to the next container in the list. To add an element to the list, the element is placed into a new container and that container is linked to one of the other containers in the list.
It is best to use an ArrayList when:
It is best to use a LinkedList when:
For many cases, the ArrayList is more efficient as it is common to need access to random items in the list, but the LinkedList provides several methods to do certain operations more efficiently:
MethodDescriptionTry it
addFirst() | Adds an item to the beginning of the list. | Try it » |
addLast() | Add an item to the end of the list | Try it » |
removeFirst() | Remove an item from the beginning of the list. | Try it » |
removeLast() | Remove an item from the end of the list | Try it » |
getFirst() | Get the item at the beginning of the list | Try it » |
getLast() | Get the item at the end of the list | Try it » |
www.w3schools.com/java/java_hashmap.asp
// Import the HashMap class
import java.util.HashMap;
public class MyClass {
public static void main(String[] args) {
// Create a HashMap object called people
HashMap<String, Integer> people = new HashMap<String, Integer>();
// Add keys and values (Name, Age)
people.put("John", 32);
people.put("Steve", 30);
people.put("Angie", 33);
for (String i : people.keySet()) {
System.out.println("key: " + i + " value: " + people.get(i));
}
}
}
import java.util.HashSet;
public class MyClass {
public static void main(String[] args) {
// Create a HashSet object called numbers
HashSet<Integer> numbers = new HashSet<Integer>();
// Add values to the set
numbers.add(4);
numbers.add(7);
numbers.add(8);
// Show which numbers between 1 and 10 are in the set
for(int i = 1; i <= 10; i++) {
if(numbers.contains(i)) {
System.out.println(i + " was found in the set.");
} else {
System.out.println(i + " was not found in the set.");
}
}
}
}
import java.util.ArrayList;
import java.util.Iterator;
public class MyClass {
public static void main(String[] args) {
ArrayList<Integer> numbers = new ArrayList<Integer>();
numbers.add(12);
numbers.add(8);
numbers.add(2);
numbers.add(23);
Iterator<Integer> it = numbers.iterator();
while(it.hasNext()) {
Integer i = it.next();
if(i < 10) {
it.remove();
}
}
System.out.println(numbers);
}
}
Primitive Data TypeWrapper Class
byte | Byte |
short | Short |
int | Integer |
long | Long |
float | Float |
double | Double |
boolean | Boolean |
char | Character |
Sometimes you must use wrapper classes, for example when working with Collection objects, such as ArrayList, where primitive types cannot be used (the list can only store objects):
public class MyClass {
public static void main(String[] args) {
Integer myInt = 5;
Double myDouble = 5.99;
Character myChar = 'A';
System.out.println(myInt.intValue());
System.out.println(myDouble.doubleValue());
System.out.println(myChar.charValue());
}
}
public class MyClass {
public static void main(String[] args) {
Integer myInt = 100;
String myString = myInt.toString();
System.out.println(myString.length());
}
}
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MyClass {
public static void main(String[] args) {
Pattern pattern = Pattern.compile("w3schools", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher("Visit W3Schools!");
boolean matchFound = matcher.find();
if(matchFound) {
System.out.println("Match found");
} else {
System.out.println("Match not found");
}
}
}
// Outputs Match found
www.w3schools.com/java/java_threads.asp
thread 와 concurrency 도 다시보기
www.w3schools.com/java/java_lambda.asp
www.w3schools.com/java/java_files.asp
www.w3schools.com/java/java_files_create.asp
www.w3schools.com/java/java_files_read.asp
www.w3schools.com/java/java_files_delete.asp
www.w3schools.com/java/java_howto_add_two_numbers.asp
www.w3schools.com/java/java_ref_string.asp
www.w3schools.com/java/java_ref_math.asp
www.w3schools.com/quiztest/result.asp
25문제 나오는 문제까지 다 풀어버렸넹
너무 간단한 내용들이었다..
갑자기 이걸 왜 본건지는 모르겠으나...
dzone.com/articles/20-useful-open-source-libraries-for-java-programme