This file contains hidden or 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 main { | |
public static void main(String[] args) { | |
String s = "Education is the most powerful weapon witch you can use to change the world."; | |
String t = "An investment in knowledge pays the best interest."; | |
System.out.println(s.substring(52, 52 + 4) + | |
t.substring(17, 17 + 9) +" " + | |
s.substring(52 + 4, s.length()-1)); | |
} | |
} |
This file contains hidden or 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 main { | |
public static void main(String[] args) { | |
double value = 25.6; | |
System.out.println((String.valueOf(value).substring(0, String.valueOf(value).indexOf("."))) +'\n' + | |
(String.valueOf(value).substring(String.valueOf(value).indexOf(".") + 1, String.valueOf(value).length()))); | |
} | |
} |
This file contains hidden or 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 main { | |
public static void main(String[] args) { | |
long millis = System.currentTimeMillis(); | |
System.out.println(millis/(24*60*60*1000L) + | |
": " + millis/(60*60*1000L) + | |
": " + millis/(60*1000L) + | |
": " + millis/(1000L)); | |
} | |
} |
This file contains hidden or 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 main { | |
public static void main(String[] args) { | |
System.out.println("WW C WW"); | |
System.out.println("RRR RRRR"); | |
System.out.println("WW WW"); | |
System.out.println("WE W WRRR"); | |
System.out.println("RWWR RWWR"); | |
System.out.println("BB BB"); | |
System.out.println(" BBRBB "); | |
System.out.println(" BBB "); |
This file contains hidden or 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 main { | |
public static void main(String[] args) { | |
String str1 = "Let us always meet each other with smile, for the smile is the beginning of love "; | |
System.out.println(str1.replaceAll("smile", ":)")); | |
} | |
} |
This file contains hidden or 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 main { | |
public static void main(String[] args) { | |
String str1 = "I've falied over and over and over again in my life and that is why I succeed"; | |
System.out.println(str1.substring(str1.indexOf("again"), str1.indexOf("again") + "again".length())); | |
} | |
} |
This file contains hidden or 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 Lesson1_HomeWork { | |
public static void main(String[] args) { | |
String mjQuote = "I've falied over and oevr and over again in my life and thats is why I succeed!"; | |
System.out.println(mjQuote.substring(mjQuote.length()-1-7, mjQuote.length()-1)); | |
} | |
} |
This file contains hidden or 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 Lesson1_HomeWork { | |
public static void main(String[] args) { | |
String mjQuote = "I'm falied over and oevr and over again in my life and thats is why I succeed!"; | |
System.out.println(mjQuote.charAt(mjQuote.length() - 1)); | |
} | |
} |
This file contains hidden or 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 Lesson1_HomeWork { | |
public static void main(String[] args) { | |
String name = "Egor"; | |
System.out.println(name.length()); | |
} | |
} |
This file contains hidden or 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 Lesson1_HomeWork { | |
public static void main(String[] args) { | |
String greeting = "Hello from Java"; | |
String str; | |
System.out.print("Some string"); | |
System.out.print("Hello "+"concatination!" ); | |
str = "155"+45; | |
System.out.print(str); | |
System.out.print(""); |