import java.util.Scanner;
public class Main {
private static Integer invertDigits(Integer number) {
Integer temp = 0;
while (number != 0) {
temp = temp * 10 + number % 10;
number /= 10;
}
return temp;
}
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
Integer number;
System.out.print("Enter number: ");
number = scanner.nextInt();
System.out.println("Reverse digit order: " + invertDigits(number));
}
}
ResultSet result = st.executeQuery("SELECT * FROM users WHERE name = 'name'");
if (!result.isBeforeFirst() ) {
// вернулось 0 строк
}
Returns:
true if the cursor is before the first row; false if the cursor is at any other position or the result set contains no rows
for (int i = 0; i < transformers.length; i++) {
int[] clonedBoard = board.clone();
transformers[i].transform(clonedBoard);
for (int j = 0; j < clonedBoard.length; j++) {
for (int k = 0; k < clonedBoard[j].length; k++) {
System.out.print(clonedBoard[j][k] + " ");
}
System.out.println();
}
System.out.println();
}
Timestamp stamp = new Timestamp(1593864000000L); // 07.04.2020 12:00 UTC
System.out.println(stamp.toString()); // 2020-07-04 15:00:00 (Moscow UTC+3)
System.out.println(stamp.getTime() == 1593864000000L); // true