package javaapplication4;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException{
String str1=new String();
String str2=new String();
BufferedReader str = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Mobile No:");
str1=str.readLine();
System.out.println("Enter again:");
str2=str.readLine();
MobileCheck ank=new MobileCheck(str1, str2);
}
}
class MobileCheck {
String s1,s2;
public MobileCheck(String str1,String str2) {
s1=str1;
s2=str2;
int i=0;
// System.out.println(s1.startsWith(String.valueOf(0)));
while(s1.startsWith(String.valueOf(0))){
s1=s1.substring(i);
// System.out.println(s1);
i++;
}
while(s2.startsWith(String.valueOf(0))){
s2=s2.substring(i);
i++;
}
if(s1.length()==s2.length()){
System.out.println("mobile no is "+s1.equals(s2));
}
else if(s1.length()>s2.length()){
i=s1.length()-s2.length();
s1=s1.substring(i);
System.out.println("Mobile no is "+s1.equals(s2));
}
else{
i=s2.length()-s1.length();
s2=s2.substring(i);
System.out.println("Mobile no is "+s1.equals(s2));
}
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException{
String str1=new String();
String str2=new String();
BufferedReader str = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Mobile No:");
str1=str.readLine();
System.out.println("Enter again:");
str2=str.readLine();
MobileCheck ank=new MobileCheck(str1, str2);
}
}
class MobileCheck {
String s1,s2;
public MobileCheck(String str1,String str2) {
s1=str1;
s2=str2;
int i=0;
// System.out.println(s1.startsWith(String.valueOf(0)));
while(s1.startsWith(String.valueOf(0))){
s1=s1.substring(i);
// System.out.println(s1);
i++;
}
while(s2.startsWith(String.valueOf(0))){
s2=s2.substring(i);
i++;
}
if(s1.length()==s2.length()){
System.out.println("mobile no is "+s1.equals(s2));
}
else if(s1.length()>s2.length()){
i=s1.length()-s2.length();
s1=s1.substring(i);
System.out.println("Mobile no is "+s1.equals(s2));
}
else{
i=s2.length()-s1.length();
s2=s2.substring(i);
System.out.println("Mobile no is "+s1.equals(s2));
}
}
}