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.alex.methods; | |
class VarArgsBadExample { | |
public static void va(int a, double b, String... s) { | |
// в методе могут быть другие параметры, кроме ... | |
} | |
public static void va(int... v) { | |
// вполне обычный метод |
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.alex.recursion; | |
public class QuickSortExample { | |
static void quickSort(int ar[], int start, int end) { | |
int L = start, R = end; | |
int M = ar[(start + end) / 2]; | |
do { |
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.alex.recursion; | |
import java.io.IOException; | |
public class Horse { | |
static int size = 5; | |
static int[][] ar = new int[size][size]; | |
static int shiftX[] = {1, 2, 2, 1, -1, -2, -2, -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 com.alex.recursion; | |
import java.io.File; | |
import java.io.IOException; | |
public class AllFiles { | |
static int totalCount = 0; | |
static void listAll(String path) |
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.alex.recursion; | |
public class MineSearcher { | |
static int width = 10; | |
static int height = 10; | |
private static int checkMines(int x, int y) { | |
// подсчёт количества мин в радиусе 1 клетки от x:y | |
return 0; |
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.alex.constructors; | |
class Person { | |
String name; | |
String surname; | |
int age; | |
Person(String n, String s, int a) { | |
name = n; |
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.alex.constructors; | |
class Person { | |
String name; | |
String surname; | |
int age; | |
Person() { // конструктор без параметров | |
name = "Иван"; |
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.alex.destructors; | |
class Person { | |
String name; | |
String surname; | |
int age; | |
Person() { // конструктор без параметров | |
name = "Иван"; |
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.alex.constructors; | |
class Person { | |
String name; | |
String surname; | |
int age; | |
Person() { // конструктор без параметров | |
name = "Иван"; |
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.alex.constructors; | |
class Person { | |
String name = "Иван"; | |
String surname = "Иванов"; | |
int age = 25; | |
Person() { // конструктор без параметров |