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 com.Lesson6; | |
// Дано текст и определенное слово. Посчитать сколько раз заданное слово встречается в тексте. | |
public class Lesson6_2 { | |
public static void main(String[] args) { | |
String text = "Ехал Грека через реку, видит Грека в реке рак, сунул Грека руку в реку, рак за руку Грека цап"; | |
String word = "Грека"; |
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 com.Lesson6; | |
//Дано 3 массива чисел. С помощью 1-2-х циклов найти сумму элементов во всех массивах. | |
public class Lesson6_3 { | |
public static void main(String[] args) { | |
int[] first = new int[] {1, 3, 5, 7, 9}; | |
int[] second = new int[] {2, 4, 6, 8, 10, 12}; | |
int[] third = new int[] {5, 10, 15}; |
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 com.Module2.Lesson1.task2; | |
public class MyClass { | |
public static void main(String[] args) { | |
for (int i = 0; i < 10; i++) { | |
MyObject object = new MyObject(); | |
} | |
System.out.println("У меня всего " + MyObject.getCount() + " объектов."); |
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 com.Module2.Lesson1.task3; | |
/*Написать класс «автомобиль», который должен уметь заводится, | |
глушить мотор, ехать и держать необходимую скорость. | |
*/ | |
public class Car { | |
private String name; | |
private int speed; | |
public void setName(String 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 com.Module2.Lesson1; | |
// Найти в массиве чисел элементы с наибольшим и наименьшим значениями. | |
public class Task5 { | |
public static void main(String[] args) { | |
int[] arr = new int[] {2, 5, 8, 0, 1, 9, 3}; | |
int t; |
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 Cars; | |
public class Car { | |
static public int count = 0; | |
protected String name; | |
protected Engine engine; | |
protected double fuel, usedFuel; |
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 Phone; | |
public class IPhone extends Phone { | |
public IPhone() { | |
System.out.println("IPhone constructor"); | |
touch = true; | |
hasWifi = true; | |
screenSize = 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 Phone; | |
public class IPhone extends Phone { | |
public IPhone() { | |
} | |
public IPhone(String number) { | |
this.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 Figure; | |
public abstract class Figure { | |
public abstract double square(); | |
} |
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 Figure; | |
public class Circle extends Figure { | |
private double radius; | |
public Circle(double radius) { | |
this.radius = radius; | |
} |
OlderNewer