Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main
- {
- public static void main(String[] args) {
- String s1 = new String("ramesh ");
- String s2 = "bad boy";
- String res = s1.concat(s2);
- System.out.println(res);
- System.out.println(res.length());
- StringBuffer s4 = new StringBuffer("Bad boy");
- System.out.println(s4);
- s4.reverse();
- System.out.println(s4);
- if (s1.equals(s2)){
- System.out.println("S1 and s2 are same");
- }
- else{
- System.out.println("S1 and S2 are not same");
- }
- }
- }
Add Comment
Please, Sign In to add comment