Java Flashcards

1
Q

Java Platform (3 elements) aka Java Development Kit (JDK)

A
  1. Programming language
  2. Java runtime environment (where the code is executed)
  3. Standard library (can be used in applications)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Standard library

A

Java Standard Edition (SE) APIs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Runtime environment

A

Java Virtual Machine (JVM) converts source code into the bytecode into the actual hardware.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Java’s principles

A
  1. Portability (should be running on any platform) (WORA - write once run anywhere)
  2. Readability
  3. Backward Compatibility (newer versions of Java must be compatible with the previous ones, so an old feature cannot be simply removed in the new release, it will only be removed after some releases, maybe even never)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Advantages

A
  1. Widely used, large community
  2. Many libraries
  3. No need to manage memory, it’s done automatically (no need to free data)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Disadvantages

A
  1. Bad in times of real-times systems (traffic, self-driving)
  2. Native code is nearly impossible to view / edit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Java vs C#

A

Differences:
- C# is faster in terms of new features
- .NET is only recently made cross-platform
- C# is dominated by Microsoft (not as rich platform)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Java vs C/C++

A
  • Java is inspired by C
  • C++ is also object-oriented like Java

Differences:
- C and C++ are unmanaged languages (you have to manage memory)
- More language features in C / C++
- C and C++ compile into the native machine code directly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Java vs Python

A
  • Both high-level
  • Both managed

Differences:
- Python is interpreted language (there is no compilation step, so a lot of time is dedicated to the runtime part to run the code immediately line by line)
- In Python you don’t specify types (it’s NOT statically typed)
- In Python they don’t care much about compatibility like Java
- Python is good for small applications where performance is not a big issue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Java vs JavaScript

A

NodeJS took JavaScript from Web

Differences:
- No compilation step (interpreted language)
- Not statically typed
- Single-threaded (using all the cores in PC is problematic)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Desktop applications (using Java)
Desktop Java

A

Using GUI toolkit (AWT - Abstract Windowing Toolkit)

Swing (Pure Java GUI) –> allows you to choose how your layout will be, regardless of your platform

Java FX also exists where you can do drag and drop, supports 3D graphics…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Enterprise Java (Java EE –> Jakarta EE)

A

When you are in the enterprise, you need to select/create libraries to match your business applications.
Enterprise Java offers APIs for common enterprise application tasks, Java updates them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Java in the Cloud

A

Uses Microframeworks such as Spring Boot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Android and Java

A
  • Primary development language for Android applications
  • But you must use Java 7 or 8 only
  • Javabytecode isn’t run on phones, DEX is run instead (Dalvik Executable Format) so Dalvik VM exists –> has to be quicker to preserve phone battery)
  • But Java on Android looks different to Java for coding
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Libraries

A

Utility Libraries
1. Spring Framework (dependency injection)
2. Google Guava (helps with IO libraries)
3. Apache Commons (Collections, CSV, IO)
4. Apache Log4J (Structured application logging)

Distributed Systems Libraries
1. Netty
2. Akka
3. RxJava
4. Apache Camel

Data-access Libraries
1. Java Database Connectivity (JDBC) (MySQL, Postgres, Oracle, H2)

Java-based Data Processing Libraries
1. Apache Hadoop (written in Java application) - it’s a distributed system for processing Big Data implemented in Java (good for batch processing)
2. Apache Spark (newer and good for streaming data)
3. DL4J - Deep Learning for Java (for NNs)
4. Datastores: Cassandra (written in Java to deal with databases), Neo4J, ElasticSearch, Hadoop Distributed File System (HDFS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

IDEs for Java

A

Eclipse (free)
IntelliJ (commercial)

17
Q

Unit Testing

A

Testing the code unit by unit.
JUnit is a unit testing framework in Java.
Mocking tools help check the units inter-connections

18
Q

Java Build Tools

A

Help automate the running of tests, modules etc.
They help identify parts that are repetitive.
Maven is a Build Tool.
Gradle is also a Build Tool (it’s incremental).

19
Q

Alternatives to Java

A