Java EE Flashcards

Study Java

1
Q

What is the difference between Java SE and Java EE?

A

SE = Standard Edition. EE = Enterprise edition; providing more tools for scalable enterprise-level applications. Enterprise Java Bean (EJB), JavaServer Pages (JSP), and Java Persistence API (JPA) can be found in Java EE.

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

What is an Application Server?

A

F`ramework that provides the necessary infrastructure and runtime environment for hosting, deploying, and executing Java-based enterprise applications.

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

What are Key Features of an application server?

A

Servlet Container
Enterprise JavaBeans (EJB) Container
JPA Provider
Connection Pooling
Security Services
Transaction Management
Clustering and Load Balancing

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

What is a Servlet Container in the Context of Java?

A

It provides the runtime environment for deploying and executing Java servlets and JavaServer Pages (JSP). Servlet containers handle incoming HTTP requests, manage the lifecycle of servlets, and generate HTTP responses.

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

What is a Enterprise JavaBeans (EJB) Container in the Context of Java?

A

It manages the lifecycle, concurrency, and transactions of Enterprise JavaBeans (EJBs), which are server-side components used for implementing business logic in Java EE applications.

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

What is a JPA Provider in the Context of Java?

A

Many application servers include a Java Persistence API (JPA) provider, which facilitates object-relational mapping (ORM) and database interaction in Java EE applications.

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

What is Connection Pooling in the Context of Java?

A

Application servers often provide connection pooling mechanisms to efficiently manage and reuse database connections, improving performance and scalability.

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

What is a Security Services in the Context of Java?

A

Application servers offer security features such as authentication, authorization, and encryption to protect sensitive data and resources within enterprise applications.

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

What is a Transaction Management in the Context of Java?

A

They support distributed transaction management, allowing multiple resources (such as databases and message queues) to participate in a single transaction, ensuring data integrity and consistency.

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

What is a Clustering and Load Balancing in the Context of Java?

A

Application servers often include features for clustering and load balancing to distribute incoming requests across multiple server instances, improving scalability and fault tolerance.

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

What is the difference between Global & Local variables in Java?

A

Global Variables:
Instance Scope. Known as instance variables because each instance of the object has its own copy of the instance variable.

Local Variables:
Method Scope. Only accessible within the scope in which they are declared (A method, code block, or constructer).

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

What are Java Applets?

A

Java applets were a feature of the Java programming language that allowed developers to embed Java programs (applets) into web pages. Better GUIs and platform independence as long as the browser ran Java. Deprecated in Java 9.

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

What is JavaFX?

A

Replaced applets. JavaFX is a modern, rich client platform for building desktop and mobile applications. New GUI Stack and developed from Swing & Abstract Window Tool Kit (AWT).

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

What are Literals and what are identifiers? Can you see them here: System.out.println(“Hello” + 1 + 2.5);

A

Identifier:
An identifier in Java is a name given to a programming element such as a variable, method, class, interface, or package. NOT Reserved Keywords (void, class, public, static)
ex. System.out.println

Literal:
A literal in Java refers to a fixed value that is written directly in the source code of a program. (Hard coded and immutable)
ex. “Hello”, 1, 2.5

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

What is a lexicon, lexical unit, syntax, semantics, and Tokens?

A

Lexicon - character set
Syntax - Defines Tokens
Semantics - Defines if it is syntactically correct
Lexical unit - character out of the lexicon
Token - Lexical Unit recognized by compiler

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

How is Java an Imperative Language?

A

Uses statements to specify a process or flow of the program.

17
Q

Atomic Statement? Examples?

A

In programming, atomicity refers to the property of an operation being indivisible or uninterruptible. An atomic operation is one that is performed as a single, indivisible unit of work, without being affected by concurrent or interleaved operations. Atomic operations are essential for ensuring data integrity and consistency, especially in multi-threaded or concurrent programming environments

  1. Assignment Statement - int x = 5;
  2. Arithmetic Operation - sum = a + b;
  3. Method Invocation - System.out.println(“Hello, world!”);
  4. Increment/Decrement Operation - count++;
  5. Empty statements - ;
18
Q

Non-Atomic Statements? Examples?

A

Non-atomic statements involve multiple steps or operations that can be divided further

  1. Compound Assignment Statement - x += 10;
  2. Conditional Statements - ‘if’ & ‘switch’
  3. Loop Statements - for, while, and do-while
19
Q

What is a JavaBean?

A

A JavaBean is just a standard. It is a regular Java class, except it follows certain conventions:

1. All properties are private (use getters/setters)
2. A public no-argument constructor
3. Implements Serializable.
20
Q

What is Serializable?

A

Serialization in Java is the concept of representing an object’s state as a byte stream

21
Q

How does Serializable work?

A

Enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable

22
Q

What is Serializable used for?

A

Serializable objects can be written to streams, and hence files, object databases, anything really