Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- public class Main {
- public static void main(String[] args)
- {
- String surname = "Иванов";
- String name = "Иван";
- String otchestvo = "Иванович";
- surname = surname.concat(" " + name);
- surname = surname.concat(" " + otchestvo);
- System.out.println(surname);
- String nameone = "Петя";
- int age = 27;
- String a = "Меня зовут ";
- String b = "Мне ";
- String c = "лет";
- String d = " ";
- a = a.concat(nameone);
- System.out.println(a);
- b = b + age;
- b = b.concat(d);
- b = b.concat(c);
- b = b.concat(d);
- System.out.println(b);
- String stroka = "всем привет";
- char rez = stroka.charAt(5);
- System.out.println(stroka.length());
- System.out.println(rez);
- char [] strokamas = stroka.toCharArray();
- for(int i = 0; i < strokamas.length; i++) {
- System.out.println(strokamas[i]);
- }
- String zamena = stroka.replace("т", "Д");
- System.out.println(stroka);
- System.out.println(zamena);
- String subs = stroka.replace("привет","пока");
- System.out.println(subs);
- String upper = stroka.toUpperCase();
- System.out.println(upper);
- String first = "Привет";
- String second = "Превет";
- if (first.equals(second))
- {
- System.out.println("SOVPADAET");
- } else
- {
- System.out.println("NE SOVPADAET");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement