Skip to content

Instantly share code, notes, and snippets.

View GlebGomenyuk's full-sized avatar

Gleb Gomenyuk GlebGomenyuk

View GitHub Profile
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = ElementType.METHOD)
public @interface AnotationTest {
int a();
int b();
@GlebGomenyuk
GlebGomenyuk / Main
Created March 8, 2020 21:52
HWJAVAPRO2_1
import java.io.FileWriter;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Scanner;
@MyAnotation(path="D:\\file.txt")
public class TextContainer {
Scanner scanner = new Scanner(System.in);
String text = scanner.nextLine();
@GlebGomenyuk
GlebGomenyuk / Main
Created March 8, 2020 21:55
HWJAVAPRO2_3
import java.io.*;
import java.lang.reflect.Field;
class SaveField implements Serializable {
int a = 12;
@Save
String b = "qwerty";
int c = 13;
@Save
boolean e = true;
@GlebGomenyuk
GlebGomenyuk / Main
Created March 8, 2020 21:55
HWJAVAPRO2_3
import java.io.*;
import java.lang.reflect.Field;
class SaveField implements Serializable {
int a = 12;
@Save
String b = "qwerty";
int c = 13;
@Save
boolean e = true;
@GlebGomenyuk
GlebGomenyuk / Main
Created March 8, 2020 21:55
HWJAVAPRO2_3
import java.io.*;
import java.lang.reflect.Field;
class SaveField implements Serializable {
int a = 12;
@Save
String b = "qwerty";
int c = 13;
@Save
boolean e = true;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class DbProperties {
private String url;
private String user;
private String password;
public DbProperties() {