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

Word Counter source code

This is the source code for the application “Word Counter”. For more information, visit: http://umersoftwares.blogspot.com/2018/06/word-counter-by-umer-softwares.html Source Code: View project on github Download project as zip file View code files: data.java hist.java infor.java mainscreen.java result.java setting.java  You may not copy, modify or redistribute it without prior permission from Hafiz Muhammad Umer (UmerSoftwares@gmail.com). The application itself can … Read more Word Counter source code