Skip to content

Commit

Permalink
Новый проект - TODO-list
Browse files Browse the repository at this point in the history
  • Loading branch information
stden committed May 20, 2015
1 parent c85ed04 commit 5592f9d
Show file tree
Hide file tree
Showing 32 changed files with 394 additions and 98 deletions.
14 changes: 9 additions & 5 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 18 additions & 28 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 00_intro.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ООП. Первое Java приложение
===========================
Синтаксис Java. ООП. Тестирование и отладка
===========================================

Знакомство
----------
Expand Down
2 changes: 1 addition & 1 deletion 01_HelloWorld/01_HelloWorld.iml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand Down
4 changes: 2 additions & 2 deletions 01_HelloWorld/0_intro.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Лексика языка Java
------------------
Лексика языка Java: комментарии, операторы, переменные, литералы, присваивание, операторные скобки
--------------------------------------------------------------------------------------------------
* Переменные
* Литералы
* Условия
Expand Down
4 changes: 2 additions & 2 deletions 01_HelloWorld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package p00_helloworld;


// Шаблоны Idea для быстрого ввода кода
// ------------------------------------
// Шаблоны Idea для быстрого ввода кода: psvm, sout+v/m, fori...
// -------------------------------------------------------------
public class IdeaLiveTemplates {
//-->
// Шаблон: psvm + <tab>
Expand Down
39 changes: 30 additions & 9 deletions 01_HelloWorld/src/main/java/p01_datatypes/A_PrimitiveTypes.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package p01_datatypes;

import java.util.Random;

/// 8 примитивных типов данных: byte, short, int, long, float, double, boolean, char
/// --------------------------------------------------------------------------------
public class A_PrimitiveTypes {
Expand All @@ -16,6 +18,7 @@ public static void main(String args[]) {
byte varWithoutValue;
varWithoutValue = 3; // Значение присваиваем позже
varWithoutValue = (byte) (varWithoutValue + 2);
System.out.println("varWithoutValue = " + varWithoutValue);

byte b = -128; // -128..127
System.out.println("b = " + b);
Expand All @@ -37,20 +40,26 @@ public static void main(String args[]) {
// 2. 16-битное целое **short**: -2^15..2^15-1 -32768..32767
//-->
short sh = 32767; // -32768..32767
System.out.println("short = " + sh + " " + Short.MIN_VALUE + ".." + Short.MAX_VALUE);
//<--

// 3. 32-битное целое **int**
//-->
int integerBinary = 0b10101010; // Начиная с Java7
System.out.println("Integer.toBinaryString(integerBinary) = " + Integer.toBinaryString(integerBinary));
// Java6
int intBin = Integer.parseInt("1011", 2);
System.out.println("intBin = " + Integer.toBinaryString(intBin));
int integerHex = 0xFFA9; // Шестнадцатеричная система счисления
System.out.printf("Hex: %04X %n", integerHex);
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
int i = 2147483647; // 2^31-1
int maxInt = 2147483647; // 2^31-1
System.out.printf("maxInt = %08X %n", maxInt);
//<--

// 4. 64-битное целое **long**
long l = 2147483648L; // 64-битное целое
System.out.println("l = " + l);

byte b1 = (byte) 0xff;
System.out.println("b1 = " + b1);
Expand Down Expand Up @@ -80,34 +89,43 @@ public static void main(String args[]) {
// Вещественные типы (действительные)
// 5. **float** - 4 байта
float floatValue = 1.0f;
System.out.printf("floatValue = %f%n", floatValue);

// 6. **double** - 8 байт
double doubleValue = 1123.22 * 1.0 / 2.3;
System.out.printf("doubleValue = %s%n", doubleValue);
System.out.println(Double.MIN_VALUE + ".." +
Double.MAX_VALUE);

// 7. Логический тип
boolean bool = true;
boolean bool2 = false;
boolean bool3 = (bool && bool2) && false;
Random random = new Random();
boolean bool = random.nextBoolean();
boolean bool2 = random.nextBoolean();
boolean bool3 = bool && bool2;
System.out.printf("bool3 = %s%n", bool3);

//
// && - логическое И
// || - логическое ИЛИ
boolean bool4 = !bool; // ! - логическое НЕ
System.out.println("bool4 = " + bool4);

// 8. Символьный тип **char**
char c1 = 'П', c2 = 'Р', c3 = 'И';
char c1 = 'П', c2 = 'Р', c3 = 'И', c4 = 'В', c5 = 'Е', c6 = 'Т';
System.out.println(c1 + c2 + c3 + c4 + c5 + c6);

//
// Переменные, методы, классы можно
// называть по-русски, имена в кодировке Unicode
char мояСимвольнаяПеременная = 'Д';
System.out.println(мояСимвольнаяПеременная);

// И это лучше чем в транслите
int moyaPremennaya = 10;
System.out.println("moyaPremennaya = " + moyaPremennaya);

int a;
a = 2;
int a = random.nextInt(10);
System.out.println("a = " + a);
// Условный оператор **if**
//-->
if (a > 1) { // Когда условие истинно
Expand Down Expand Up @@ -137,8 +155,8 @@ public static void main(String args[]) {
}

//
// Сокращённая форма, инкремент/декремент, префиксный/постфиксный
// --------------------------------------------------------------
// Сокращённая форма: +=, -=..., инкремент/декремент, префиксный/постфиксный
// -------------------------------------------------------------------------
//-->
// Сложение
a = a + 10;
Expand All @@ -155,10 +173,13 @@ public static void main(String args[]) {
// Инкремент
a = a + 1;
a++; // Постфиксная форма
System.out.println("a = " + a);
a = 2;
int aa = a++; // aa = 2
System.out.println("aa = " + aa);
// a = 3
int a1 = ++a; // a1 = 4, a = 4
System.out.println("a1 = " + a1);
++a; // Префиксная форма
// Декремент
a = a - 1;
Expand Down
16 changes: 4 additions & 12 deletions 01_HelloWorld/src/main/java/p01_datatypes/Z_SquareEq.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

import static java.lang.Math.*;

// Решение квадратного уравнения
// -----------------------------
//
// **Решение квадратного уравнения**
//
public class Z_SquareEq {
public static void main(String args[]) {
// Считываем коэффициенты с клавиатуры
Expand Down Expand Up @@ -45,13 +46,4 @@ public static void main(String args[]) {
}
//<--
}
}

// Графические библиотеки:
// -----------------------
// * AWT (Abstract Window Toolkit) - исходная платформо-независимая оконная библиотека графического интерфейса
// (Widget toolkit) языка Java
// * Swing - библиотека для создания графического интерфейса для программ на языке Java.
// * JavaFX - платформа для создания RIA, позволяет строить унифицированные приложения
// с насыщенным графическим интерфейсом пользователя для непосредственного запуска из-под операционных систем,
// работы в браузерах и на мобильных телефонах, в том числе, работающих с мультимедийным содержимым.
}
2 changes: 1 addition & 1 deletion 02_OOP/02_OOP.iml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand Down
2 changes: 1 addition & 1 deletion 03_ModifiersDemo/03_ModifiersDemo.iml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand Down
2 changes: 1 addition & 1 deletion 04_JUnit/04_JUnit.iml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand Down
2 changes: 1 addition & 1 deletion HW_ResumeModel/HW_ResumeModel.iml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand Down
Loading

0 comments on commit 5592f9d

Please sign in to comment.