Day 14 of 100 - Java: basic examples and Java RMI example
Janardhan Pulivarthi
Posted on January 22, 2022
Journal note: 📝
I have started asking for referrals for a programming job, from my friends. And also actively applying for jobs. :)
Check for Palindrome
String
String str = "rar", reverseStr = "";
int strLength = str.length();
for(int i=(length-1); i > 0; i--) {
reverseStr = reverseStr + str.CharAt(i);
}
if (str.equals(reverseStr))
System.out.print("The string is Palindrome");
Number
int num = 1001, reverseNum = 0;
if (num != 0) {
reverseNum = num%10 + reverseNum * 10;
num = num / 10;
}
Transpose of a matrix
int row=2, column=3;
int[][] matrix = {{1,2,3}, {4,5,6}};
int[][] transpose = new int[column][row];
for (int i=0; i < row; i++) {
for (int j=0; j < column; j++) {
transpose[j][i] = matrix[i][j];
}
}
Java RMI
💖 💪 🙅 🚩
Janardhan Pulivarthi
Posted on January 22, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.