This file contains 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
class Ex1 { | |
public static void main(String args[]) { | |
int a = 4; | |
if((a % 2) == 0) | |
System.out.println(" is Even number" + a); | |
else | |
System.out.println(" is Odd number" + a ); | |
} |
This file contains 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
class Ex2 { | |
public static void main(String[] args) { | |
String s = ("I will adopt best practices "); | |
for (int i = 0; i < 7; i++) { | |
System.out.println(s); | |
} | |
} | |
} |
This file contains 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 Ex3 { | |
public static void main(String[] args) { | |
for (int i = 10; i >= 0; i = i - 2) { | |
System.out.print(i + " "); | |
} | |
} | |
} |
This file contains 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 Ex4 { | |
public static void main(String[] args) { | |
for (int i = 0; i <= 20; i = i + 2) { | |
System.out.print(i + " "); | |
} | |
} | |
} |
This file contains 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 Ex5 { | |
public static void main(String[] args) { | |
for (int i = 1; i <=15; i++) { | |
if (i % 3 == 0) | |
System.out.print(i + " "); | |
} | |
} | |
} |
This file contains 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 Ex6 { | |
public static void main(String... args){ | |
for(int i = 1; i < 10; i++){ | |
for(int k = 1; k < 10; k++){ | |
System.out.print(k * i + " "); | |
} | |
System.out.println(""); | |
} | |
} | |
} |
This file contains 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 Ex1 { | |
public static void main(String[] args) { | |
System.out.printf("Площадь %.2f",geroneSquare(14, 12, 12)); | |
} | |
public static double geroneSquare(double a, double b, double c) { | |
double p = (a + b + c) / 2; |
This file contains 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.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.Reader; | |
public class Task1 { | |
public static void main(String[] args) throws IOException { | |
File file = new File("D:/test-java.txt"); | |
file.createNewFile(); |
This file contains 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 { | |
static Strauss strauss; | |
static Vorobei vorobei; | |
public static void main(String[] args) { | |
Strauss strauss = new Strauss(); | |
Strauss.dvijenie = "Бегу"; | |
strauss.dvijenie(); | |
Vorobei vorobei = new Vorobei(); |