Giter Site home page Giter Site logo

java-by-experiments-private's Introduction

If you have a question about Java, you can probably Google it and find Stackoverflow question with the answer in a few minutes. Or you could spend hours writing an experimental program that also gives you the answer!

Learn about java fundementals by writing experimental programs. Each article will cover as small of a concept as possible. The article will start with a question, and hide the answer in an expand block.

For each article you should:

  1. Try to think about the question and guess it.
  2. Try to write a program that will help you explore the answer. How does it compare with your guess?
  3. Expand the answer block, and compare with your what you learned from your experiment.
  4. Inspect the code included with the article and compare the approach.

Topics:

  1. Concurrency
    1. What happens when you get a deadlock with synchronized in java?
    2. What happens when you get a deadlock with locks in java? Is it any different from synchronized?
    3. Can a thread promote their ReentrantReadWriteLock.readLock() to a ReentrantReadWriteLock.writeLock()?
  2. Performance
    1. What's the max num of connections a server and client can concurrently keep open?
    2. What happens if you don't close something properly?
    3. How many threads until your JVM crashes?
    4. How does native memory impact heap? OS memory?
    5. Does ArrayList have a limit? LinkedList?
    6. Does Spark work well with Protobuf?
  3. Date and time
    1. Does System.currentTimeMillis() or System.nanoTime() ever decrease? ever repeat?
  4. Exceptions
    1. What does stack trace of the overrided method look like compared to super class's method?
  5. JDBC
    1. Where can you use '?' in prepared statements?

Future topics:

  1. What happens when you get a deadlock in jdbc?
  2. Does synchronized use fair locking?
  3. What line throws NPE when you try to autobox a null?
  4. What happens to your thread when you gracefully kill the java process?
  5. What happens to the runnables in an ExecutorService when you gracefully kill the java process?
  6. What happens when an Runnable in an ExecutorService throws an exception?
  7. What hapepns when a Callable in an Executor Service throws an exception and you call .get() on the future?
  8. Can in inner class use the privates of the holding class?
  9. How do you chain method calls when Non-null, nullable, primitive, and optional?
  10. What happens when you print an array? Does toString() call toString on each element? What about an ArrayList?
  11. Converting bytes to string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.