Skip to content

Commit

Permalink
java basic lesson #5
Browse files Browse the repository at this point in the history
  • Loading branch information
biblelamp committed May 25, 2024
1 parent 2c76ffe commit 8caaee1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions BerlinTelran/JavaBasic/JavaBasic5Lesson.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import java.util.Random;
import java.util.Scanner;

class JavaBasic5Lesson {
public static void main(String[] args) {
String str = new String("Hello,");
String strJava = " Java!";
String strResult = str.concat(strJava);
System.out.println(strResult);
System.out.println(strResult.contains("abc"));
System.out.println(strResult.indexOf("Java"));
System.out.println(str.equalsIgnoreCase("hello,"));
System.out.println(strResult.length());
System.out.println(strResult.substring(7, 11));
System.out.println(strResult.toUpperCase());
strResult += " Hi!";
System.out.println(strResult);
for (int i = 0; i < str.length(); i++) {
System.out.print(str.charAt(i) + "-");
}
System.out.println(Math.PI);
}
}

0 comments on commit 8caaee1

Please sign in to comment.