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..
FizzBuzz Write a program that prints the numbers from 1 to 100 and for multiples of '3' print "Fizz" instead of the number and for the multiples of '5' print "Buzz". Solution in Java (Converting int to String) 1 2 3 4 5 6 7 8 9 10 11 public class Main{ public static void main(String[] args) { for (int i = 1; i
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
- Javascript Algorithm
- Object type casting
- ... in Javascript
- repeat()
- hackerrank solution
- compareTo()
- easy javascript algorithm
- 프로그래머스
- Collection Framework
- code refactoring
- math.max
- 프로그래머스 알고리즘문제
- spring boot application
- hackerrank
- easy algorithm
- equals()
- 알고리즘
- hackerrank javascript solution
- HashMap
- algorithm
- rest parameter
- java
- substring()
- HackerRank Algorithm
- javascript
- string class in java
- C++
- math.abs
- hackerrank javascript
- 프로그래머스 알고리즘
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |