Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package ja12;
- /**
- *
- * @author Administrator
- */
- public class JA12 {
- public static void main(String[] args) {
- // TODO code application logic here
- String s = "JAAAAAAAAAB ADADD";
- String res = s + "!!!!";
- System.out.println(res);
- // метод charAt - позволяет получить по индексу определенный символ
- char ch1 = s.charAt(0);
- System.out.println("ch1=" + ch1);
- // метод для получения длины строки
- int len = s.length();
- System.out.println("len=" + len);
- //
- String substring = s.substring(0, 3);
- System.out.println("substring=" + substring);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement