Collection - InterfaceCollection is a base interface of the Java Collection Framework for List, Set and Queue. Collections - classCollections is a class in java.util package and it is utility class for Collection.Collections class has methods for Sorting, Searching etc ExampleCollections.addAll(A,B); Collections.addAll method takes all of the elements of 'B' and fetch the elements to the collect..
1. Arrays.asList() method makes the original array available as a list. Example codepublic class Main{ public static void main(String[] args) { String[] fruit_array = new String[]{"apple","banana","mango"}; List fruit_list = Arrays.asList(fruit_array); //returned List is fixed size fruit_list.add("melon"); //Error fruit_list.remove(0); //Error fruit_list.set(1,"kiwi"); System.out.println(fruit_l..
Lambda Expression It must be the *Functional Interface to use Lambda expression.*It's an interface with only one abstract methodLambda Expression enables method argument to treat functionality. It let you create an instance more compactly.Inside Lambda expression, it is not allowed to change variables. 여러줄의 코드를 메서드에 넣을 때 사용하는 개념. functional interface (한개의 메서드만 가지는 클래스) 일때만 람다식을 사용할 수 있다.오버라이딩으로 ..
compareTo() method in Java compareTo() method compares the Number and an argument. The argument and the number object should be the same types. Example code public class Test { public static void main(String args[]) { Integer i = 3; System.out.println(i.compareTo(2)); //returns '1' : Integer is greater than the argument System.out.println(i.compareTo(3)); //returns '0' : Integer is equal to the ..
Unlike primitive data type, the reference data type is user-defined, for which it contains a reference or an address. It has Array type, Class type and Interface type etc. create a reference data type Person p; allocated statically in the stack at compile time. create a reference data type and objectPerson p = new Person(); allocated dynamically in the heap Referencehttps://www.quora.com/What-ar..
1. Anonymous class has no name so, It allows a base class to implement without a name.2. It is often used for overriding the methods of a class or interface. 3. It can be used only once. Person p = new Person(); // semi-colon 을 지우고 중괄호를 열어서 코드를 시작해준다. public void greeting() // greeting method를 overriding해준다. // overriding은 subclass에서만 사용가능하기에 p가 person class의 자식클래스에서 왔다는 것을 알수있다.// 이곳에서는 Person의..
- Total
- Today
- Yesterday
- string class in java
- HashMap
- C++
- rest parameter
- javascript
- hackerrank javascript
- HackerRank Algorithm
- compareTo()
- easy javascript algorithm
- 프로그래머스
- Object type casting
- 프로그래머스 알고리즘문제
- java
- hackerrank
- substring()
- repeat()
- 프로그래머스 알고리즘
- math.abs
- easy algorithm
- hackerrank solution
- 알고리즘
- ... in Javascript
- Javascript Algorithm
- math.max
- equals()
- algorithm
- code refactoring
- hackerrank javascript solution
- spring boot application
- Collection Framework
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |