+ 1
Overloaded method to enter string and check 1.letter appear at the start and end,special word 2.two string equal?3.char at n pos
I cannot get the output of the second overloaded function. In the main method, i have entered two strings but in the execution it cannot take 2 string as input. If anyone can help me out in this. See to my code and help me find my mistake. https://code.sololearn.com/cZ8owm4YMGKw/?ref=app
5 Answers
0
ch1=in.next().charAt(0);
This cause reading stop when space or new line is encountered but nextLine reading this space or newline to next input. So this cause s2 having extra space at start..
Take it like
ob.display(s2.substring(1),s3);
Or take
ch1=in.nextLine().charAt(0);
+ 1
Help me out plz!!!!
+ 1
Jayakrishnađźđł In the second function in which two strings are taken as input. It is not taking input two strings and giving output as "The strings are not equal". See to this
+ 1
Jayakrishnađźđł Thanks a lot. I understood.
0
It working fine..
What inputs you are giving..? How?