Here are the main articles:
- “Thinking in Java” Bruce Eckel 4th Edition
- Oracle Java tutorials
- "Дизайн-патерни — просто, як двері Andriy Buday
- Stackoverflow
Java intro - theoretical part of the language
- JVM, JDK, JRE
- Class loader
- Garbage collector
HW:
- Read article http://docs.oracle.com/javase/tutorial/getStarted/TOC.html
- Install JDK, JRE v 1.8 from http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Install IDE (on your choice):
- IntelliJ IDEA
- Overview link, getting started, how-tos, demos: https://www.jetbrains.com/idea/documentation/
- Downloads: https://www.jetbrains.com/idea/download/
- Eclipse
- Overview link, getting started: https://eclipse.org/users/
- Downloads: https://eclipse.org/downloads/
- Others are up to you
- Write “Hello world!” according manual: http://docs.oracle.com/javase/tutorial/getStarted/cupojava/index.html.
- Compile it with command line using javac, run via command line (java), decompile with javap.
- Compile in IDE, run in IDE
Java intro - theoretical part of the language
- Objects
- Variables, variable initialization, memory allocation
- Variable types: primitive and Objects
- Packages (package organization strategies)
- Java operators
- Expressions, statements and Blocks
HW:
- Read http://docs.oracle.com/javase/tutorial/java/nutsandbolts/index.html
- Read http://docs.oracle.com/javase/tutorial/java/concepts/package.html
- Read sources of Object class, learn methods that contain
- Read Practices for Java package organization
- Read Packages naming
- Read chapter “Introduction to Objects”, “Everything is an Object”, “Operators” from “Thinking in Java”
- To do http://docs.oracle.com/javase/tutorial/java/nutsandbolts/QandE/questions_variables.html
- To do http://docs.oracle.com/javase/tutorial/java/nutsandbolts/QandE/questions_operators.html
- To do http://docs.oracle.com/javase/tutorial/java/nutsandbolts/QandE/questions_expressions.html
Control statements and modifiers for methods/variables
- Control flow statements (if-then, if-then-else, switch)
- Loops (for, while, do-while, foreach)
- Access modifiers: private, package, protected, private (variables, methods)
- Static modifier for variable and methods, static block of initialization
- Final (variable, methods, constructors)
HW:
- Read http://docs.oracle.com/javase/tutorial/java/nutsandbolts/index.html
- Read chapters ”Controlling execution”, “Access Control” from “Thinking in Java”
- To do http://docs.oracle.com/javase/tutorial/java/nutsandbolts/QandE/questions_flow.html
Class, constructors, overriding, inheritance
- OOP principles (Encapsulation, Inheritance, Polymorphism)
- Class abstraction (class, object)
- Constructors
- Order of object initialization (static blocks, static fields, parent constructor calls in inheritance chain)
- Overriding, overloading. Difference between ordinary and static methods “overriding”. Can variables be overridden?
HW:
- Read subparagraphes from http://docs.oracle.com/javase/tutorial/java/javaOO/classes.html
- Read subparagraphes from http://docs.oracle.com/javase/tutorial/java/javaOO/objects.html
- Read subparagraphes from http://docs.oracle.com/javase/tutorial/java/javaOO/more.html
- Read article http://docs.oracle.com/javase/tutorial/java/concepts/index.html
- Read: chapters “Initialization & Cleanup”, “Reusing Classes”, “Polymorphism” from “Thinking in Java”
- To do http://docs.oracle.com/javase/tutorial/java/javaOO/QandE/creating-questions.html
- To do http://docs.oracle.com/javase/tutorial/java/javaOO/QandE/objects-questions.html
Nested Classes, Enum type
- Nested classes
- Local classes
- Anonymous classes
- Enum type
- Classes modifiers: final, static/non-static, access modifiers
HW:
- Read subparagraphes from http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html
- Read chapter “Inner classes” from “Thinking in Java”
- Read chapter “Enumerated Types” from “Thinking in Java”
- To do http://docs.oracle.com/javase/tutorial/java/javaOO/QandE/nested-questions.html
- To do http://docs.oracle.com/javase/tutorial/java/javaOO/QandE/enum-questions.html
Interfaces and abstract classes, some design patterns
- Interface (definition, purposes, related Java key words, multiple “inheritance” via interfaces, @Overridden annotation)
- Abstract class (definition, purposes, related Java keywords, inheritance rules)
- Design patterns Factory, Template method, Singleton, Chain of responsibilities, Builder, Adapter
HW:
- Read chapter “Interfaces” from “Thinking in Java”
- Read design patterns Factory, Template method, Singleton, Chain of responsibilities, Builder, Adapter from DesignPatterns_AndriyBuday.pdf
- Read articles from http://docs.oracle.com/javase/tutorial/java/IandI/index.html
- Read article from http://docs.oracle.com/javase/tutorial/java/annotations/index.html
- To do http://docs.oracle.com/javase/tutorial/java/IandI/QandE/interfaces-questions.html
- To do http://docs.oracle.com/javase/tutorial/java/IandI/QandE/inherit-questions.html
Numbers and Strings
- String class
- String concatenation (operations under + operator)
- StringBuilder, StringBuffer
- Constant pool
- String equals, hashcode methods
- Number classes (Integer, Double,...)
- Numbers autoboxing and unboxing
HW:
- Read sources of String, StringBuilder, StringBuffer
- Read http://docs.oracle.com/javase/tutorial/java/data/index.html
- Read chapter “Strings” from “Thinking in Java”
- To do http://docs.oracle.com/javase/tutorial/java/data/QandE/numbers-questions.html
- To do http://docs.oracle.com/javase/tutorial/java/data/QandE/characters-questions.html
Java Collections
- Java collection hierarchy
- The Collection Interface
- The Set Interface and implementations
- The List Interface and implementations
- The Queue Interface and implementations
- The Deque Interface and implementations
- The Map Interface and implementations
- The SortedSet Interface and implementations
- The SortedMap Interface and implementations
HW:
- Read articles from http://docs.oracle.com/javase/tutorial/collections/interfaces/
- Read http://docs.oracle.com/javase/tutorial/collections/implementations/index.html
- To do http://docs.oracle.com/javase/tutorial/collections/implementations/QandE/questions.html
- To do http://docs.oracle.com/javase/tutorial/collections/interfaces/QandE/questions.html
Java Generics
- Java Generics
HW:
- Read http://docs.oracle.com/javase/tutorial/java/generics/index.html
- Read chapter “Generics” from “Thinking in Java”
- To do http://docs.oracle.com/javase/tutorial/java/generics/QandE/generics-questions.html
Multithreading
- Monitors
- Synchronization
- Class Thread (thread start, run)
- Runnable, Callable interfaces
- Synchronized, volatile keywords
HW:
- Investigate http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html
- Read http://docs.oracle.com/javase/tutorial/essential/concurrency/procthread.html
- Read subparagraphes from http://docs.oracle.com/javase/tutorial/essential/concurrency/threads.html
- Read subparagraphes from http://docs.oracle.com/javase/tutorial/essential/concurrency/sync.html
- Write a program that calculate a sum of series
Error handling with Exceptions
- Throwable
- Error
- Exception, RuntimeException
- Hierarchy of exceptions
- try-catch-finally
- try-with-resources for AutoClosable classes (introduced java 7)
HW:
- Read http://docs.oracle.com/javase/tutorial/essential/exceptions/
- To do http://docs.oracle.com/javase/tutorial/essential/exceptions/QandE/questions.html
- Read chapter “Error handling with exceptions”
- Read Autoclosable resource with try in JDK 7+
Unit testing
- Unit testing (what is it? purposes?)
- Junit
- Mock objects (Mockito overview)
HW:
- Read https://en.wikipedia.org/wiki/Unit_testing
- Investigate: http://junit.org
- Investigate: http://docs.mockito.googlecode.com/hg/org/mockito/Mockito.html
- Read: http://habrahabr.ru/post/72617/
Java Naming Conventions
HW:
- Read http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html OR http://google-styleguide.googlecode.com/svn/trunk/javaguide.html
- Read http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
Build automation tools (optional paragraphs)
- Maven
- Gradle
HW:
- Investigate http://www.tutorialspoint.com/maven/maven_overview.htm
- Investigate https://gradle.org/overviewhttps://gradle.org/learn
- Read Java Build Tools: Ant vs Maven vs Gradle
New features in Java 8. Design patterns (optional paragraphs)
HW:
- Read http://www.javacodegeeks.com/2014/05/java-8-features-tutorial.html
- Read http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html
- Read DesignPatterns_AndriyBuday.pdf
Tasks that should be sent to us:
These tasks should be sent to checkpoint.10per@gmail.com before 6th of the April 2015. Please, use mail accounts that you used to send HTML tasks. Any works sent from other mail accounts won't be checked. Please, specify mail topic "Java - task". Before implementing any task read Java Naming Conventions attentively.
- Implement application that “shuffle” an array randomly. Just 25% of array elements should be “shuffled”. “Shuffled” positions are chosen randomly too. Implement unit tests for this functionality. Array can be one or two dimensional. Array is input param.
- Implement 3 data structures that use all features of LinkedList, ArrayList, Map. This data structures should have all appropriate functionalities and also should automatically remove “old” objects. “Old” means object that were created earlier then some date/time. Implement unit tests for this functionality. Date/time should be input param.
- Implement an app that calculate a sum of series 2^(i - (-1)^i). i from 1 to n. Calculation should be done in parallel mode. Input params: n, count of threads. Result should be the same on all runs for specific n. Please, implement 2 variants: with executors and creating your own thread pool. Implement unit tests for this functionality. Please, implement ability to run this program from console and from file. Example: 5 7 (first number is n, then space, then count of threads, line break). File exampe
- Create a program that accept expression that describe the phone number:
- The main part of the phone consists of three groups, each with a length from 2 to 3 numbers (eg., 55 55 555);
- Optionally before the main number - area code inside the country, 3-4 numbers (999, 2345);
- Optionally before the area code - the international country code, starting with a "+" (eg., 7) or service area code (8);
- All of the phone parts can be connected with a space or a hyphen; area code can optionally be taken in parentheses.
- Using regular expressions, clean code in the file src.java from comments. Program should accept any correct java source file. Implement unit tests for this functionality.
- Implement app that calculate frequency of words in text using several threads. Path to the file, count of threads are given params, separated by space in console. Create unit tests for this functionality.
This program should accept 2 modes: inputs from console, inputs from file. File example. Implement unit tests for this functionality.
Course work. Mobile networks
Implement a mobile network. Think about your mobile phones. Try to emulate real system. You have several mobile operators and can instantiate new one: Life, MTS, Kievstar and so on.Mobile operators have
- Different phone numbers
- Different rates for mobile services inside internal network
- Different rates for mobile connection with other mobile operators
- Incoming and outgoing calls can be charged or can be free (it depends on the package). Mobile operators should have ability to change their settings easily
- Subscription fee may be charged on monthly basis, 25 days basis or can not be charged (or on your choice)
- The consumer can change mobile package (this may cost some money)
- The consumer can have different discounts if the person stays with one mobile operator during some period
- The consumer can charge his/her account with money or with minutes (f.e. package that allow you to talk free 100 minutes per day and you pay 5 hrn each day automatically OR just charge your account with 20 hrns that converts to 5000 minutes for month). It’s up to your choice.
- If some package program is old, mobile operators can transfer all consumers to new one. This should be done easily. Do not forget to inform consumers about this transfer. Implement notification system.
- Consumers should receive notifications if something happened with his/her package/subscription/or account doesn’t contain enough money to perform an operation, continue automatic subscription and so on. The consumer should receive feedbacks about successful operations or errors during execution with user friendly descriptions. Also consumer should receive notifications if person is subscribed for some services and money are charged automatically. The consumer should receive notifications if his/her account doesn’t contain enough money or subscription is going to finish.
- The consumer may have ability to transfer their money from one mobile account (phone number) to another inside internal network, but it’s forbidden for accounts in different networks. This service might cost something or might not.
- Implement mobile towers. Mobile towers can accept calls from consumers that are located in 1 km (this distance is param and can be changed). Also mobile towers can accept calls just from one mobile operator or from others if this tower is owned by one mobile operator or is shared with others. Mobile tower has restrictions on amount of connections in current time (for example 10 connections). During implementation of call/SMS functions your program should connect to the nearest available (with available connections) tower that accept calls from consumer’s mobile operator and is located in acceptable distance (it’s 1 km in this example). Try to emulate talk of 2 consumers. Try to emulate talks of several groups of consumers.
- Implement call/SMS functions. Remember that it’s concurrent environment. Emulate busy status when consumer is talking with other consumer.
Try to emulate all actions with mobile package (subscribe, unsubscribe, shift to another mobile package, charge account, use your money/minutes while talking (emulate “mobile incoming call”, “mobile outgoing call”, “mobile incoming SMS”, “mobile outgoing SMS”, “mobile internet”), try to make your account zero or less than zero balanced, charge account again and try to buy a service that cost more than your current balance, receive a notification that you do not have enough money), emulate connection inside internal network, or with other operators (you need to create several consumers). Test your application properly with several users, emulate connections, sending/receiving SMS, calls. Implement several operators with different mobile towers. You can simplify functionality of mobile towers and imagine that all consumers are located in points that are not changed (it means that distance for one consumer to towers doesn't change during the period of your app working). However, if you want to have a dynamic environment you are welcome.
Do not afraid to use design patterns. Try to find and implement at least 2 design patterns that matches your situation. Implement unit test with mocked objects for whole system.
Please, note that all mobile packages and costs should be easily changed (classes contains setters, getters, appropriate constructors and architecture design). You are welcome to use database storages if you want, but it's optional. If you decide to use it, you can use also build automation tool for resolving dependencies (Maven, Gradle, etc.).