Podcast
Questions and Answers
Flashcards
Java String Comparison: "==" vs new String()
Java String Comparison: "==" vs new String()
The ==
operator performs reference equality in Java, comparing if two strings are literally the same object in memory. The new String()
creates a new object instance even if the literal value is identical, thus making s1 == s3
false. "abc" is a string literal and is treated as a unique object, hence s1 == s2
is true.
Java continue
& break
in Loops
Java continue
& break
in Loops
The continue
statement skips the current iteration of the loop and jumps to the next one. The break
statement completely terminates the loop's execution. This code increments y
and checks conditions. Even numbers are skipped (y % x == 0
), and the loop breaks at y == 8
. Only odd numbers less than 8 are printed.
Java Inheritance and Shadowing
Java Inheritance and Shadowing
In Java, inheritance follows the principle of "hiding" or "shadowing". The child class (B) inherits the parent class (A) but can declare member variables (like int a
) with the same name. So, within the scope of class B, obj.a
refers to B's a
(20). However, because obj
is declared as type A, only A's methods are accessible, hence a
(10) is printed.
Reversing an Array in Java
Reversing an Array in Java
Signup and view all the flashcards
Java Interface Default Methods and Multiple Inheritance
Java Interface Default Methods and Multiple Inheritance
Signup and view all the flashcards
What is NOT a J2EE component?
What is NOT a J2EE component?
Signup and view all the flashcards
Key Feature of Enterprise JavaBeans (EJB)
Key Feature of Enterprise JavaBeans (EJB)
Signup and view all the flashcards
Purpose of JNDI in J2EE
Purpose of JNDI in J2EE
Signup and view all the flashcards
Role of web.xml
in J2EE
Role of web.xml
in J2EE
Signup and view all the flashcards
Servlet's primary function in J2EE
Servlet's primary function in J2EE
Signup and view all the flashcards
Mapping Immutable Entities in Hibernate
Mapping Immutable Entities in Hibernate
Signup and view all the flashcards
Hibernate's @Fetch(FetchMode.SUBSELECT)
annotation
Hibernate's @Fetch(FetchMode.SUBSELECT)
annotation
Signup and view all the flashcards
Hibernate's Second-Level Cache
Hibernate's Second-Level Cache
Signup and view all the flashcards
Hibernate's @version
annotation
Hibernate's @version
annotation
Signup and view all the flashcards
Hibernate's @NaturalId
annotation
Hibernate's @NaturalId
annotation
Signup and view all the flashcards
Spring @Component
Annotation
Spring @Component
Annotation
Signup and view all the flashcards
Spring @Autowired
Annotation
Spring @Autowired
Annotation
Signup and view all the flashcards
What is Spring Boot?
What is Spring Boot?
Signup and view all the flashcards
Spring @Transactional
Annotation
Spring @Transactional
Annotation
Signup and view all the flashcards
Defining Custom Scopes in Spring
Defining Custom Scopes in Spring
Signup and view all the flashcards
The Role of WSDL in SOAP Web Services
The Role of WSDL in SOAP Web Services
Signup and view all the flashcards
HTTP PUT in RESTful APIs
HTTP PUT in RESTful APIs
Signup and view all the flashcards
What is UDDI?
What is UDDI?
Signup and view all the flashcards
HATEOAS : REST API Principle
HATEOAS : REST API Principle
Signup and view all the flashcards
WS-Security in SOAP Web Services
WS-Security in SOAP Web Services
Signup and view all the flashcards
Strategy Pattern: Why Composition?
Strategy Pattern: Why Composition?
Signup and view all the flashcards
The Bridge Pattern
The Bridge Pattern
Signup and view all the flashcards
Protection Proxy Pattern
Protection Proxy Pattern
Signup and view all the flashcards
State Pattern
State Pattern
Signup and view all the flashcards
Singleton Pattern in Multithreaded Environments
Singleton Pattern in Multithreaded Environments
Signup and view all the flashcards
Microservices Architecture: Key Principle
Microservices Architecture: Key Principle
Signup and view all the flashcards
Service Registry in Microservices
Service Registry in Microservices
Signup and view all the flashcards
The Role of API Gateway in Microservices
The Role of API Gateway in Microservices
Signup and view all the flashcards
CAP Theorem in Distributed Systems
CAP Theorem in Distributed Systems
Signup and view all the flashcards
Circuit Breaker Pattern in Microservices
Circuit Breaker Pattern in Microservices
Signup and view all the flashcards
JavaScript this
Keyword in Callbacks
JavaScript this
Keyword in Callbacks
Signup and view all the flashcards
CSS3 Transform Property for 3D Effects
CSS3 Transform Property for 3D Effects
Signup and view all the flashcards
Grouping Options in a Dropdown List
Grouping Options in a Dropdown List
Signup and view all the flashcards
CSS position: sticky;
Property
CSS position: sticky;
Property
Signup and view all the flashcards
JavaScript this
in IIFEs
JavaScript this
in IIFEs
Signup and view all the flashcards
React's useEffect
Hook
React's useEffect
Hook
Signup and view all the flashcards
React's useMemo
Hook
React's useMemo
Hook
Signup and view all the flashcards
React's React.memo
Function
React's React.memo
Function
Signup and view all the flashcards
React's useCallback
Hook
React's useCallback
Hook
Signup and view all the flashcards
React Context API
React Context API
Signup and view all the flashcards
AWS Service for Running Docker Containers
AWS Service for Running Docker Containers
Signup and view all the flashcards
AWS Lambda: Serverless Computing
AWS Lambda: Serverless Computing
Signup and view all the flashcards
AWS CloudFormation: Infrastructure as Code
AWS CloudFormation: Infrastructure as Code
Signup and view all the flashcards
AWS DynamoDB: NoSQL Database
AWS DynamoDB: NoSQL Database
Signup and view all the flashcards
AWS CodePipeline: CI/CD Service
AWS CodePipeline: CI/CD Service
Signup and view all the flashcards
SQL HAVING Clause
SQL HAVING Clause
Signup and view all the flashcards
Correlated Subquery in SQL
Correlated Subquery in SQL
Signup and view all the flashcards
Creating an Index in SQL
Creating an Index in SQL
Signup and view all the flashcards
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.