Skip to content

Instantly share code, notes, and snippets.

package rojeckt;
public class MyFirstProgramm {
public static void main(String[] args) {
System.out.println(3 * 7 * 24 * 60 * 60);
}
}
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);
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();
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);
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));
}
}
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()));
}
}
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",":)"));
}
}
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");
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);
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));