Podcast
Questions and Answers
Study Notes
CORE JAVA
-
String Comparison:
- Comparing string literals (
s1
ands2
) results intrue
. - Comparing a literal with a newly created string (
s1
ands3
) returnstrue
for equality butfalse
for object reference equality.
- Comparing string literals (
-
Loop Output:
- The code iterates through numbers from 1-9.
- It skips multiples of 2.
- It breaks when
y
equals8
. - The output is
1357
.
-
Class Hierarchy Output:
- In a class hierarchy, properties are inherited, but overridden members take precedence.
- The output of
obj.a
is10
whenobj
refers to anA
object. - Because of inheritance, the
obj
variable is actually a reference to classB
object even though the variable name isobj
. The output fromA
is printed
J2EE
-
J2EE Components:
- Servlets, JSPs, and Enterprise JavaBeans (EJBs) are components of J2EE architecture.
- AWT (Abstract Window Toolkit) is not part of J2EE.
-
EJB Functionality:
- EJBs support distributed transactions.
- They are used for enterprise-level functionality.
-
JNDI Role:
- JNDI (Java Naming and Directory Interface) provides an API for directory service lookup and data retrieval based on names.
-
Deployment Descriptor:
- The
web.xml
deployment descriptor configures web application deployment, defining servlets and URL mappings.
- The
Hibernate
-
Immutability Mapping:
- Use the
@Immutable
annotation to map immutable entities in Hibernate.
- Use the
-
Fetch Mode:
-
@Fetch(FetchMode.SUBSELECT)
fetches associated collections using a subselect query in one database roundtrip to boost efficiency.
-
-
Second-Level Cache:
- The second-level cache in Hibernate is visible to all sessions and is not specific to a single session.
-
Optimistic Locking:
- The
@version
annotation is used for optimistic locking in Hibernate. It marks the field for version checking to prevent conflicts if multiple developers try to edit the same database records
- The
Spring
-
Component Scanning:
- The
@Component
annotation is used to define a Spring component, enabling automatic detection and registration by Spring.
- The
-
Dependency Injection:
-
@Autowired
automatically injects dependencies by type.
-
-
Spring Boot:
- Spring Boot uses a CLI for development, testing, and packaging, reducing boilerplate code.
-
Transactions:
-
@Transactional
marks a method for transaction management.
-
-
Custom Scopes:
- Use the
@Scope
annotation for customized bean scopes.
- Use the
Web Services
-
WSDL (Web Services Description Language):
- WSDL describes web service methods, including parameters and return types. This description is used in service discovery and communication.
-
HTTP Methods (REST):
-
PUT
is an idempotent HTTP method usually used for resource updates in RESTful web services.
-
-
UDDI:
- UDDI (Universal Description, Discovery, and Integration) acts as a registry for businesses and their web services, enabling clients to discover web services based on names.
-
HATEOAS:
- HATEOAS (Hypermedia As The Engine Of Application State) is a critical concept in RESTful web services, where the next steps are hyperlinked in returned documents. The client learns which actions are possible and how to make those actions by examining the links.
-
WS-Security:
- WS-Security is not used to encrypt data at rest.
Java Web Design
-
JavaScript Output:
- Javascript code outputing NaN as the result of summing a function.
-
3D Transformation: -The
transform
property is used in CSS3 to apply various 3D transformations to an element. -
HTML5 Options Grouping: -The
optgroup
element in HTML5 is used to group options together in a drop-down list for better organization -
Sticky Positioning: -The
position: sticky
attribute in CSS3 positions an element relative to its normal position but makes it fixed at a specific offset to the viewport as the user scrolls.
React
-
Component Re-rendering:
-
React.memo
prevents re-rendering of a component if its props haven't changed.
-
-
Use Callback:
- The output from the snippet is
2
because of theReact.useCallback
hook, which memoises the callback.
- The output from the snippet is
-
Context API:
- Context API in React can be used to pass values without prop drilling if the desired props are needed deeper down in the component tree
AWS
-
Docker Containers:
- Amazon ECS (Elastic Container Service) is used for running Docker containers in AWS.
-
AWS Lambda:
- Lambda runs code without provisioning or managing servers, typically used for serverless functions.
-
CloudFormation:
- AWS CloudFormation automates resource management; provisioning, and configuration changes by treating resources as code.
-
DynamoDB:
- Amazon DynamoDB is a NoSQL database service in the cloud.
-
CI/CD:
- AWS CodePipeline is a CI/CD service to automate changes (integration, testing, and deployment) to software.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on Core Java string comparisons, loop outputs, and class hierarchy, along with J2EE components like Servlets and EJBs. This quiz will challenge your understanding of object-oriented programming and enterprise architecture in Java.