String is the important data type in programming. In Java there are many functions of string which are use to manipulate the records which exist in string. The string will be equal if and only if they have same length and character.
Source Code
package com.stringmatch.www; import java.util.Scanner; public class Compare_string { public static void main(String[] args) { String a =""; String b =""; Scanner input = new Scanner (System.in); System.out.println(" Enter Your Sentence "); a = input.nextLine(); System.out.println(" Enter Your Sentence "); b = input.nextLine(); if ( a.equals(b)) { System.out.println(" Sentence Match "); } else { System.out.println(" Sentence Does not Match "); } } }
0 comments:
Post a Comment