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
package lesson1; | |
public class Barrel3 { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
System.out.println("В трёх неделях - " + 60*60*24*7*3 + " секунд."); | |
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
package lesson1; | |
public class DataTypes1 { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
System.out.println("hi"); | |
System.out.println("hello" + "world"); |
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
/** | |
* | |
*/ | |
package lesson1; | |
/** | |
* @author alex | |
* | |
*/ | |
public class S { |
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
package lesson1; | |
public class CharAtLength { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
String mjQuote = "I'm failed over and over and over again in my lyfe and that 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
package substring; | |
public class SubstringExtra { | |
/** | |
* @param args | |
*/ | |
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 succeed!"; |
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
package substring; | |
public class SubstringAgain { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
String mjQuote = "I've failed over and over and over again" + |
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
package substring; | |
public class SubstringReplace { | |
public static void main(String[] args) { | |
String mtQuote = new String("Let us always meet each other with smile, for the smile is a beginning of love."); | |
System.out.println(mtQuote.replace("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
package subsrtringZakreplenije; | |
public class PoleBoja { | |
public static void main(String[] args) { | |
System.out.println("B B B B B B B B B"); | |
System.out.println("C B W B W B C"); | |
System.out.println("B B B W B W B B B"); | |
System.out.println("R R B B B B B R R"); |
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
import java.util.Date; | |
public class Zakreplenie { | |
public static void main(String[] args) { | |
long curTime = System.currentTimeMillis(); | |
Date curDate = new Date(curTime); | |
System.out.println(curTime); | |
System.out.println(curDate); |
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 ZakreplenieTeacher { | |
public static void main(String[] args) { | |
double myValue = 25.6; | |
System.out.println((String.valueOf(myValue)).substring(0, (String.valueOf(myValue)).indexOf("."))); | |
System.out.println((String.valueOf(myValue)).substring(((String.valueOf(myValue)).indexOf(".")+1), (String.valueOf(myValue)).length())); |
OlderNewer