miroslavbstoyanov

Untitled

Sep 30th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Problem1 {
  4. public static void main(String[] args) {
  5. String result = "1";
  6. String stringA = "Some unique string";
  7. String stringB = "Some unique string";
  8. Object obj = (Object) stringA;
  9.  
  10. if (obj == stringB) {
  11. result += "1";
  12. }/*else*/if (obj.equals(stringB)){
  13. result+= "2";
  14. } else{
  15. result += "3";
  16. }
  17.  
  18. int i = 0;
  19. String newString = i++ + "4" + ++i;
  20. newString += i++;
  21. result += newString;
  22.  
  23. int x =3, y=5;
  24. int a = x+y-x/y+2;
  25. int b = (x+y)-x/(y+2);
  26. result += "" + a + b;
  27. System.out.println(result);
  28.  
  29.  
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment