This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rojeckt; | |
public class MyFirstProgramm { | |
public static void main(String[] args) { | |
System.out.println(3 * 7 * 24 * 60 * 60); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rojeckt; | |
public class MyFirstProgramm { | |
public static void main(String[] args) { | |
String a = "Hello my name is "; | |
String b = "Ilya i am "; | |
String f = ""; | |
int x = 13; | |
System.out.print(f+a+b+x); | |
System.out.print(f); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
System.out.println("ilyaBroBrother".length()); | |
String name = "ilyaBroBrother"; | |
System.out.println(name.length()); | |
System.out.println(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
String drQuote = "my name ilya. im live in kiev. im like computer"; | |
int length = drQuote.length(); | |
char ch = drQuote.charAt(length - 1); | |
System.out.println(ch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
String mjQuote = "I've failed over and over and over again in my life and that is why I succed! "; | |
System.out.println(mjQuote.substring(70, 76)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
String mjQuote = "I've failed over and over and over again in my life and that is why I succed! "; | |
System.out.println(mjQuote.substring(mjQuote.indexOf("again"), mjQuote.indexOf("again") + "again".length())); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
String mtQuote = "lets us always meet each other with smile,for the smile isthe beginning of love"; | |
System.out.println(mtQuote.replace("smile",":)")); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
System.out.println("B B B B B B B B B"); | |
System.out.println("B C T C B"); | |
System.out.println("BRRR RR RR R RB"); | |
System.out.println("BWW R B"); | |
System.out.println("B WW WW B"); | |
System.out.println("B E B"); | |
System.out.println("B WW WW B"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
// we must calculate how many D:H:M:S from 1 January 1970 to today | |
long time = System.currentTimeMillis()/1000; | |
int day = (int) time / (60 * 60 * 24); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Documents { | |
public static void main(String[] args) { | |
double value = 25.6; | |
String str = String.valueOf(value); | |
int p= str.indexOf('.'); | |
System.out.println(str.substring(0,p)); | |
System.out.println(str.substring(p+1)); |
OlderNewer