mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
'compare()' method can be used to compare primitives -> 'compare()' method can be used to compare numbers
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
public class Test {
|
||||
public void test(int a, int b) {
|
||||
if(Integer.compare(a, b) > 0) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
public class Test {
|
||||
public int test(String s1, String s2) {
|
||||
int res = Integer.compare(s1.length(), s2.length());
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
class Test {
|
||||
public void test(String s1, String s2) {
|
||||
int res;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
class Test {
|
||||
public int test(String s1, String s2) {
|
||||
return Integer.compare(s1.length(), s2.length());
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
public class Test {
|
||||
public void test(String s1, String s2) {
|
||||
System.out.println(Integer.compare(s1.length(), s2.length()));
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
public class Test {
|
||||
public void test(int a, int b) {
|
||||
if(((Integer)a).compa<caret>reTo(b) > 0) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
public class Test {
|
||||
public int test(String s1, String s2) {
|
||||
int res = new Integer(s1.length()).co<caret>mpareTo(s2.length());
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
class Test {
|
||||
public void test(String s1, String s2) {
|
||||
int res;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
class Test {
|
||||
public int test(String s1, String s2) {
|
||||
if(s1.length() < s2.length()) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
public class Test {
|
||||
public void test(String s1, String s2) {
|
||||
System.out.println(s1.<caret>length() < s2.length() ? -1 : s1.length() == s2.length() ? 0 : 1);
|
||||
|
||||
Reference in New Issue
Block a user