KakaoTalk_20190606_001802318.png
  • 246x0w
Welcome
Curriculum
Install&Go
Board
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
  • 카테고리
  • 전체 게시물
  • 내 게시물
leejyjulia
2020년 7월 30일

200730

게시판: 소스 코드 제출

//import java.util.*;

//public class Main {

// public static void main(String[] args) {

// ArrayList<String> collection1 = new ArrayList<>();

// collection1.add("New York");

// collection1.add("Atlanta");

// collection1.add("Dallas");

// collection1.add("Madison");

//

// System.out.println("A list of cities int collection1: ");

// System.out.println(collection1);

//

// System.out.println("\nIs Dallas in collection1? " + collection1.contains("Dallas"));

//

// collection1.remove("Dallas");

// System.out.println("\n" + collection1.size() + " cities are in collection1 now");

//

// Collection<String> collection2 = new ArrayList<>();

// collection2.add("Seattle");

// collection2.add("Portland");

// collection2.add("Los Angeles");

// collection2.add("Atlanta");

//

// System.out.println("\nA list of cities in collection2:");

// System.out.println(collection2);

//

// ArrayList<String> c1 = (ArrayList<String>)(collection1.clone());

// c1.addAll(collection2);

// System.out.println("\nCities in collection1 or collection2: ");

// System.out.println(c1);

//

// c1 = (ArrayList<String>)(collection1.clone());

// c1.retainAll(collection2);

// System.out.print("\nCities in collection1 and collection2: ");

// System.out.println(c1);

//

// c1 = (ArrayList<String>)(collection1.clone());

// c1.removeAll(collection2);

// System.out.print("\nCities in collection 1, but not in 2: ");

// System.out.println(c1);

// }

//}



//import java.util.*;

//

//public class Main {

// public static void main(String[] args) {

// Collection<String> collection = new ArrayList<>();

// collection.add("New York");

// collection.add("Atlanta");

// collection.add("Dallas");

// collection.add("Madison");

//

// Iterator<String> iterator = collection.iterator();

// while (iterator.hasNext()) {

// System.out.print(iterator.next().toUpperCase() + " ");

// }

// System.out.println();

// }

//}



//import java.util.*;

//public class Main {

// public static void main(String[] args) {

// Vector<Integer> v = new Vector<Integer>();

// v.add(5);

// v.add(4);

// v.add(-1);

// v.add(2,100);

//

// Iterator<Integer> it = v.iterator();

// while(it.hasNext()) {

// int n = it.next();

// System.out.println(n);

// }

//

// int sum = 0;

// it = v.iterator();

// while (it.hasNext()) {

// int n =it.next();

// sum += n;

// }

// System.out.println("the sum of vector: " + sum);

// }

//}



//import java.util.*;

//public class Main{

// public static void main(String[] args) {

// List<Integer> arrayList = new ArrayList<>();

// arrayList.add(1);

// arrayList.add(2);

// arrayList.add(3);

// arrayList.add(1);

// arrayList.add(4);

// arrayList.add(0,10);

// arrayList.add(3,30);

//

// System.out.println("A list of integers in the array list: ");

// System.out.println(arrayList);

//

// LinkedList<Object> linkedList = new LinkedList<>(arrayList);

// linkedList.add(1, "red");

// linkedList.removeLast();

// linkedList.addFirst("green");

//

// System.out.println("Display the linked list forward:");

// ListIterator<Object> listIterator = linkedList.listIterator();

// while (listIterator.hasNext()) {

// System.out.print(listIterator.next() + " ");

// }

// System.out.println();

//

// System.out.println("Display the linked list backward:");

// listIterator = linkedList.listIterator(linkedList.size());

// while (listIterator.hasPrevious()) {

// System.out.print(listIterator.previous() + " ");

// }

// }

//}




//import java.util.*;

//public class Main{

// public static void main(String[] args) {

// ArrayList<String> a = new ArrayList<String> ();

//

// Scanner scanner = new Scanner(System.in);

// for(int i=0; i<4; i++) {

// System.out.print("enter name>>");

// String s = scanner.next();

// a.add(s);

// }

//

// for(int i=0; i<a.size(); i++) {

// String name = a.get(i);

// System.out.print(name + " ");

// }

// int longestIndex = 0;

// for(int i=1; i<a.size(); i++) {

// if(a.get(longestIndex).length() < a.get(i).length());

// longestIndex = i;

// }

// System.out.println("\nThe longest name is: " + a.get(longestIndex));

// scanner.close();

// }

//}


댓글 0개
0
댓글
댓글 0개
유사 게시물
  • 200730 숙제
  • 200730
  • 200730
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호