Day 14 of 100 - Java: basic examples and Java RMI example

j143

Janardhan Pulivarthi

Posted on January 22, 2022

Day 14 of 100 - Java: basic examples and Java RMI example

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");
Enter fullscreen mode Exit fullscreen mode

Number

int num = 1001, reverseNum = 0;

if (num != 0) {
  reverseNum = num%10 + reverseNum * 10;
  num  = num / 10;
}

Enter fullscreen mode Exit fullscreen mode

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];
  } 
}
Enter fullscreen mode Exit fullscreen mode

Java RMI

https://github.com/j143/java-rmi-example

💖 💪 🙅 🚩
j143
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.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024