Skip to content

Instantly share code, notes, and snippets.

View Yur-ok's full-sized avatar

Yuriy Bachevskiy Yur-ok

  • WorldWideWeb
View GitHub Profile
package Lesson2.KeyPoin1;
/**
* Created by Юрий on 08.12.2015.
*/
public class HelloMethod {
public static void main(String[] args) {
hello("Yurok");
hello(777);
@Yur-ok
Yur-ok / StringConcatination.java
Created December 5, 2015 19:20
Use knowledge to change the world
package Lesson1_frame5;
/**
* Created by Юрий on 06.12.2015.
*/
public class StringConcatination {
public static void main(String[] args) {
String s = "Education is the most powerful weapon which you can use to change the world.";
String t = "An investment in knowledge pays the best interest.";
@Yur-ok
Yur-ok / DoubleValue.java
Created December 5, 2015 19:04
25.6 => 25 и 6
package Lesson1_frame5;
/**
* Created by Юрий on 06.12.2015.
*/
public class DoubleValue {
public static void main(String[] args) {
double value = 25.6;
String val = String.valueOf(value);
System.out.println(val.substring(0,2));
@Yur-ok
Yur-ok / TimeMillis.java
Created December 5, 2015 18:16
D:H:M:S
package Lesson1_frame5;
/**
* Created by Юрий on 05.12.2015.
*/
public class TimeMillis {
public static void main(String[] args) {
long ms = System.currentTimeMillis();
System.out.println(ms);
@Yur-ok
Yur-ok / MapOfBattleField.java
Created December 5, 2015 16:36
Map of battle field
package Lesson1_frame5;
/**
* Created by Юрий on 05.12.2015.
*/
public class MapOfBattleField {
public static void main(String[] args) {
System.out.println("B B B B B B B B B B");
System.out.println("C B B B C B B B C");
@Yur-ok
Yur-ok / Replace.java
Created December 5, 2015 14:34
Replace "smile" to ":)"
package Lesson1_frame4;
/**
* Created by Юрий on 05.12.2015.
*/
public class Replace {
public static void main(String[] args) {
String mtQoute = "Let us always meet each other with smile, for the smile is the beginning of love.";
@Yur-ok
Yur-ok / Again.java
Created December 5, 2015 14:21
Substring "again" without counting characters
package Lesson1_frame4;
/**
* Created by Юрий on 05.12.2015.
*/
public class Again {
public static void main(String[] args) {
String mjQuote = "I'm failed over and over and over again in my life and that is why I succeed!";
@Yur-ok
Yur-ok / Succeed.java
Created December 4, 2015 18:42
Поиск подстроки
package Lesson1_frame4;
/**
* Created by Юрий on 05.12.2015.
*/
public class Succeed {
public static void main(String[] args) {
String mjQuote = "I'm failed over and over and over again in my life and that is why I succeed!";
@Yur-ok
Yur-ok / LastSymbol.java
Created December 4, 2015 18:11
Находим послдений символ в строке, в не зависимости от того как меняется сама строка.
package SecondProgramm;
/**
* Created by Юрий on 05.12.2015.
*/
public class LastSymbol {
public static void main(String[] args) {
String mjQuote = "I'm failed over and over and over again in my life and that is why I succeed!";
System.out.println(mjQuote.charAt(mjQuote.length()-1));
@Yur-ok
Yur-ok / StringLength.java
Created December 4, 2015 17:47
Пример использования метода length()
package SecondProgramm;
/**
* Created by Юрий on 05.12.2015.
*/
public class StringLength {
public static void main(String[] args) {
String name = "Yuriy";
System.out.println(name.length());
}