Java program to reverse a sentence

Problem Write a java program to: Reverse a sentence by letters Reverse a sentence by words Reverse Sentence by letters Code  public class Main {      public static void main(String[] args) {          String sentence=“Welcome to java”;          System.out.println(reverseByLetters(sentence));      }      public static String reverseByLetters(String sentence){          char[] c=sentence.toCharArray();          String out=“”;          for (int i=c.length–1;i>=0;i—){              out+=c[i];          }          return out;      }  }   Output avaj ot emocleW Explanation First, we broke the String sentence into characters by calling the toCharArray() function on the string. … Read more Java program to reverse a sentence

Set EditText to input Numbers only

The input type of EditText in Android can be restricted. We can set it to input numbers only. There are the following types of numbers that we can set the EditText to input Unsigned Integer Signed Integer Unsigned Decimal Signed Decimal We will learn how to do this using XML and programmatically using java code. … Read more Set EditText to input Numbers only

Java program to convert Binary to Decimal

I am going to discuss three different ways to convert binary to decimal in java. Using the built-in Integer.parseInt() method Building our own logic when the binary number is given as a String variable Building our own logic when the binary number is given as an int variable Basic Concept of Conversion Let’s say we … Read more Java program to convert Binary to Decimal

How to upload a Netbeans project to Github?

In this post you are going to learn how to upload a NetBeans project to GitHub. This project can be in any language Java or python or any other programming language that you can use in NetBeans IDE. Requirements A github account A project opened in Netbeans IDE An active internet connection Procedure Create a … Read more How to upload a Netbeans project to Github?