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 ReverseString { | |
public static void main(String[] args) { | |
String oldString = "abc1d2e fgh3i"; | |
String[] words = oldString.split(" "); | |
String alphabet = "abcdefghijklmnopqrstuvwxyz"; | |
StringBuilder sentenceBuilder = new StringBuilder(); | |
for (String word : words) { | |
StringBuilder wordBuilder = new StringBuilder(); | |
char[] unletterSymbols = new char[word.length()]; |
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 Solution | |
{ | |
public static void main(String[] args) throws IOException | |
{ | |
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); | |
String sourceFileName = reader.readLine(); | |
String destinationFileName = reader.readLine(); | |
java.io.FileInputStream fileInputStream = new java.io.FileInputStream(sourceFileName); |
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 Test1 { | |
static int x = 0; | |
public static void main(String[] args) { | |
beta(); | |
} | |
public static void beta() { |
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
mysql> show tables; | |
+-----------------------+ | |
| Tables_in_clientsbase | | |
+-----------------------+ | |
| addresses | | |
| client_course | | |
| clients | | |
| courses | | |
| groups | |
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
import java.sql.*; | |
public class Main { | |
private static final String DB_DRIVER = "com.mysql.jdbc.Driver"; | |
private static final String DB_CONNECTION = "jdbc:mysql://localhost:3306/ordersdb"; | |
private static final String DB_USER = "****"; | |
private static final String DB_PASSWORD = "********"; | |
private static Connection getDBConnection() { | |
Connection dbConnection = null; |
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 Flat { | |
private String district; | |
private String address; | |
private double area; | |
private int rooms; | |
private int price; | |
public Flat(String district, String address, double area, int rooms, int price) { | |
this.district = district; |
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 module1.lesson4.task1; | |
/* | |
Написать функцию, которая принимает в качестве аргументов одну строку X, целое число Y и число с плавающей точкой Z | |
и возвращает как результат строку в виде | |
S = x + y + z. | |
*/ | |
public class Main { |
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 module1.lesson4.task4; | |
/* | |
Написать ф-ю для объединения 2-х массивов в один. Вывести результат на консоль. | |
*/ | |
import java.util.Arrays; | |
public class Main { | |
public static void main(String[] args) { |
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 module1.lesson4.task3; | |
/* | |
Написать ф-ю, которая принимает на вход массив чисел и возвращает его длину в байтах как результат. | |
*/ | |
public class Main { | |
public static void main(String[] args) { | |
int[] array = new int[] {1, 2, 3, 4, 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 module1.lesson4.task2; | |
/* | |
Написать функцию, которая принимает массив чисел в качестве аргумента, увеличивает его первые 3 элемента на 1 | |
и возвращает их сумму как результат. После изменения массив и сумму надо вывести на экран. | |
*/ | |
import java.util.Arrays; | |
public class Main { |
NewerOlder