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 StrokaPodstanovka { | |
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."; | |
int use = s.indexOf("use"); | |
int knowledge = t.indexOf("knowledge"); | |
int to = s.indexOf("to"); |
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 method; | |
import java.util.Scanner; | |
public class MethodHi { | |
public static void main(String[] args) { | |
hello(); | |
} |
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 method; | |
public class Sum { | |
public static void main(String[] args) { | |
sum(5, 3); | |
} | |
static void sum(int a, int b){ | |
System.out.println(a + b); |
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 method; | |
public class Square { | |
public static void main(String[] args) { | |
square(3); | |
} | |
static void square(double number) { | |
System.out.println(number * number); |
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 method; | |
public class Square { | |
public static void main(String[] args) { | |
System.out.println(square(5)); | |
System.out.println(square(2.5)); | |
} |
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 logic; | |
public class If { | |
public static void main(String[] args) { | |
System.out.print("Esche ne rodilsya(-4 goda) - "); | |
System.out.println(oldEnough(-4)); | |
System.out.print("5 let - "); | |
System.out.println(oldEnough(5)); | |
System.out.print("20 let - "); |
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 logic; | |
public class Min { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
System.out.println(min(19,5,-9)); |
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 logic; | |
public class MinElseIf { | |
public static void main(String[] args) { | |
System.out.println(min(-19,5,-9)); | |
} | |
static int min(int a, int b, int c){ | |
if (a<b){ |
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 logic; | |
public class IfMonth { | |
public static void main(String[] args) { | |
System.out.println(isSpring(4)); | |
System.out.println(isSpring(9)); | |
System.out.println(isSpring(12)); | |
System.out.println(isSpring(-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 tanks; | |
public class GetQuadrant { | |
public static void main(String[] args) { | |
System.out.println(getQuadrant("a", "1")); | |
System.out.println(getQuadrant("a", "2")); | |
System.out.println(getQuadrant("b", "2")); |