Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. package com.company;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6. String str1, str2,str3, str4;
  7. str1= "Andrey Yerzhov";
  8. str2="ICS126";
  9. str3="Annna";
  10. str4="Yerzhov Andrey Alexandrovich";
  11. StringMethods str = new StringMethods();
  12. System.out.print("Task #1. String ends with 'ed': ");
  13. if(str.StringEnding(str1)) System.out.println("True");
  14. else System.out.println("False");
  15. System.out.print("Task #2. The sum of all digits in the string = ");
  16. System.out.println(str.SumOfDigit(str2));
  17. System.out.print("Task #3. Length of the longest block = ");
  18. System.out.println(str.LongestBlock(str3));
  19. System.out.println("Task #4. All words founded in the string:");
  20. str.FindWords(str4);
  21. System.out.print("Task #5. The mix of two strings:");
  22. str.TwoStrings(str2,str3);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement