write a program in Java to take input name of the person and print the surname first and then name
Answers
Answered by
1
may be
<html><body>class Surname{ void input(String s) { int len=s.length(); int in=0; char a; int last= s.lastIndexOf(‘ ‘); int first=s.indexOf(‘ ‘); String sur=s.substring(last+1); }}</body></html>
<html><body>class Surname{ void input(String s) { int len=s.length(); int in=0; char a; int last= s.lastIndexOf(‘ ‘); int first=s.indexOf(‘ ‘); String sur=s.substring(last+1); }}</body></html>
Similar questions