Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. package com.company;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args)
  6. {
  7. String surname = "Иванов";
  8. String name = "Иван";
  9. String otchestvo = "Иванович";
  10.  
  11. surname = surname.concat(" " + name);
  12. surname = surname.concat(" " + otchestvo);
  13. System.out.println(surname);
  14. String nameone = "Петя";
  15. int age = 27;
  16. String a = "Меня зовут ";
  17. String b = "Мне ";
  18. String c = "лет";
  19. String d = " ";
  20. a = a.concat(nameone);
  21. System.out.println(a);
  22. b = b + age;
  23. b = b.concat(d);
  24. b = b.concat(c);
  25. b = b.concat(d);
  26. System.out.println(b);
  27. String stroka = "всем привет";
  28. char rez = stroka.charAt(5);
  29. System.out.println(stroka.length());
  30. System.out.println(rez);
  31. char [] strokamas = stroka.toCharArray();
  32. for(int i = 0; i < strokamas.length; i++) {
  33. System.out.println(strokamas[i]);
  34.  
  35. }
  36. String zamena = stroka.replace("т", "Д");
  37. System.out.println(stroka);
  38. System.out.println(zamena);
  39. String subs = stroka.replace("привет","пока");
  40. System.out.println(subs);
  41. String upper = stroka.toUpperCase();
  42. System.out.println(upper);
  43. String first = "Привет";
  44. String second = "Превет";
  45. if (first.equals(second))
  46. {
  47. System.out.println("SOVPADAET");
  48. } else
  49. {
  50. System.out.println("NE SOVPADAET");
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement