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 ..
Methods of String class substring()to get substring using substring(include index,exclude index); 12String i="java"; System.out.println(i.substring(1,2));//a cs length()to get the length of the string. 123String s="javastring"; System.out.println("string length is: "+s.length());//10 Colored by Color Scriptercs equals() equals() method compares two strings found on the content of the string. if ..
- Total
- Today
- Yesterday
- 프로그래머스
- hackerrank javascript solution
- math.max
- substring()
- ... in Javascript
- equals()
- 알고리즘
- algorithm
- compareTo()
- math.abs
- HackerRank Algorithm
- 프로그래머스 알고리즘
- code refactoring
- HashMap
- java
- spring boot application
- rest parameter
- hackerrank
- easy algorithm
- Object type casting
- 프로그래머스 알고리즘문제
- Javascript Algorithm
- javascript
- C++
- string class in java
- easy javascript algorithm
- hackerrank javascript
- repeat()
- Collection Framework
- hackerrank solution
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |