Tag

Object Creation

1 views collected around this technical thread.

Java Tech Enthusiast
Java Tech Enthusiast
Apr 2, 2025 · Backend Development

Java Object Creation: New vs Reflection Efficiency Comparison

The article compares Java object creation using the 'new' operator versus reflection, showing through timed code examples that reflection incurs a substantial overhead—approximately thirty times slower for 100 million instances—due to dynamic type resolution and limited JIT optimization, while also outlining typical reflection use cases such as Spring IoC and JDBC driver loading.

Backend DevelopmentJavaObject Creation
0 likes · 4 min read
Java Object Creation: New vs Reflection Efficiency Comparison
Lobster Programming
Lobster Programming
Dec 16, 2024 · Fundamentals

How Many Objects Does Java Create for Different String Initializations?

This article explains how Java creates objects for various String assignments—using new String("long"), a literal "long", or concatenated literals "lo" + "ng"—detailing when one or two objects are allocated based on the presence of the literal in the string constant pool.

Constant PoolJavaMemory Management
0 likes · 3 min read
How Many Objects Does Java Create for Different String Initializations?
Architect's Tech Stack
Architect's Tech Stack
Sep 16, 2023 · Fundamentals

Understanding Java Object Creation, JVM Memory, and Class Loading

This article explains how Java objects are created using the new operator, details the JVM memory model (stack and heap), describes the generation and loading of .class files by the ClassLoader, compares Class.newInstance() with new, and outlines the initialization steps and key concepts developers must master.

Class LoadingJVMJava
0 likes · 11 min read
Understanding Java Object Creation, JVM Memory, and Class Loading
Selected Java Interview Questions
Selected Java Interview Questions
Sep 16, 2023 · Backend Development

Performance Comparison of new Operator and Reflection for Object Creation in Java

The article explains Java's basic concepts of object creation, compares the execution speed of using the new operator versus reflection, analyzes why reflection is slower, and outlines typical scenarios where each method is appropriate, supported by benchmark code and results.

Backend DevelopmentJavaObject Creation
0 likes · 5 min read
Performance Comparison of new Operator and Reflection for Object Creation in Java
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 12, 2023 · Fundamentals

Understanding the Builder Design Pattern with Java Examples

The Builder pattern separates object construction from its representation, enabling the same construction process to produce varied complex objects, and is illustrated through a Java house-building example that defines abstract and concrete builders, a product class, a director, and client code.

Builder PatternDesign PatternJava
0 likes · 6 min read
Understanding the Builder Design Pattern with Java Examples
Top Architect
Top Architect
Nov 17, 2022 · Fundamentals

Understanding Java String Object Creation and Memory Allocation

This article explains how Java handles string literals and new String objects, detailing the creation of objects in the constant pool and heap, the resulting memory layout, and the outcomes of reference comparisons, while also providing code examples and additional resources.

Constant PoolJavaMemory Management
0 likes · 5 min read
Understanding Java String Object Creation and Memory Allocation
Architect's Tech Stack
Architect's Tech Stack
Nov 8, 2022 · Fundamentals

Java Object Creation: new vs Reflection – Performance Comparison and Usage Scenarios

This article explains the fundamental differences between creating objects with the new operator and using Java reflection, presents benchmark code showing a large performance gap, analyzes the reasons behind the slowdown, and outlines practical scenarios where reflection is appropriate.

JavaObject CreationPerformance
0 likes · 5 min read
Java Object Creation: new vs Reflection – Performance Comparison and Usage Scenarios
Java Architect Essentials
Java Architect Essentials
Sep 10, 2022 · Fundamentals

A Generic Builder Pattern for Simplifying Java Object Creation

This article demonstrates how to replace verbose Java object instantiation and setter calls with a reusable generic Builder that supports chained property setting via functional interfaces, showing both a simple example and a full implementation supporting up to three parameters per setter.

Builder PatternDesign PatternsGeneric Builder
0 likes · 8 min read
A Generic Builder Pattern for Simplifying Java Object Creation
Selected Java Interview Questions
Selected Java Interview Questions
Apr 30, 2022 · Backend Development

Understanding Java Object Creation, JVM Memory Layout, and Class Loading Process

This article explains how Java creates objects with the new operator, details the JVM's stack and heap memory model, describes class loading and the role of Class objects, and compares newInstance with new, providing code examples and visual diagrams for deeper comprehension.

Class LoadingJVMJava
0 likes · 14 min read
Understanding Java Object Creation, JVM Memory Layout, and Class Loading Process
Cognitive Technology Team
Cognitive Technology Team
Mar 19, 2022 · Fundamentals

Advantages and Disadvantages of Using Static Factory Methods in Java

Static factory methods in Java offer several benefits over constructors—named creation, instance reuse, flexible return types, and the ability to vary returned subclasses based on parameters—while also presenting drawbacks such as reduced subclassability and discoverability, making them a selective alternative for object creation.

Code ExampleDesign PatternJava
0 likes · 6 min read
Advantages and Disadvantages of Using Static Factory Methods in Java
IT Services Circle
IT Services Circle
Feb 14, 2022 · Fundamentals

Six Ways to Create Objects in Java

This article presents six Java object‑creation techniques—including direct instantiation, cloning, reflection‑based allocation, dynamic class loading, constructor invocation via reflection, and deserialization—explaining each method with code examples and practical notes for developers.

CloningJavaLombok
0 likes · 7 min read
Six Ways to Create Objects in Java
Yiche Technology
Yiche Technology
Dec 20, 2021 · Backend Development

Understanding Spring Circular Dependency and Its Resolution Mechanism

This article explains how Spring Framework resolves circular dependencies during object creation using a three-level caching mechanism, detailing the process through code examples and architectural diagrams.

Backend DevelopmentCaching MechanismsCircular Dependency
0 likes · 6 min read
Understanding Spring Circular Dependency and Its Resolution Mechanism
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 23, 2021 · Fundamentals

Builder Pattern in Java: Implementation, Usage, and Comparison with Simple Factory

This article explains the Builder design pattern in Java with complete code examples—including Product, abstract Builder, ConcreteBuilder, Director, and client code—demonstrates the output, compares it to the simple factory pattern, and briefly shows how ASM bytecode manipulation can generate similar constructs.

Builder PatternDesign PatternsJava
0 likes · 6 min read
Builder Pattern in Java: Implementation, Usage, and Comparison with Simple Factory
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 29, 2021 · Fundamentals

Understanding the Singleton Pattern: Definition, Nine Implementations, Pros & Cons, and Android Applications

This article explains the Singleton design pattern, its core concept of ensuring a single instance, presents nine Java implementations with code examples, compares their advantages and disadvantages, discusses real‑world usage in Android and general development, and offers guidelines for when to apply the pattern.

AndroidDesign PatternsJava
0 likes · 15 min read
Understanding the Singleton Pattern: Definition, Nine Implementations, Pros & Cons, and Android Applications
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 14, 2021 · Backend Development

Various Ways to Create Objects in Java: new, newInstance, Reflection, Cloning, and Deserialization

This article explains the multiple techniques for creating objects in Java—including the new operator, Class.newInstance, reflection with Constructor, cloning via Cloneable, and deserialization—while illustrating the underlying bytecode instructions and providing concrete code examples for each method.

CloningJavaObject Creation
0 likes · 8 min read
Various Ways to Create Objects in Java: new, newInstance, Reflection, Cloning, and Deserialization
JD Retail Technology
JD Retail Technology
Oct 20, 2020 · Fundamentals

Understanding the Object Creation Process in Objective‑C

This article explains how Objective‑C creates objects by detailing the two creation methods, the internal alloc and init implementations, the callAlloc workflow, memory allocation, and the final binding of the isa pointer, with full source code excerpts for each step.

Memory AllocationObject CreationObjective-C
0 likes · 11 min read
Understanding the Object Creation Process in Objective‑C
Architect's Tech Stack
Architect's Tech Stack
Jun 24, 2020 · Fundamentals

How Java Objects Are Created and Managed in the JVM

This article explains the JVM's process for creating Java objects, covering class loading checks, memory allocation strategies such as bump‑the‑pointer and free‑list, object header composition, instance data layout, alignment padding, and the ways references locate objects via handles or direct pointers.

JVMJavaObject Creation
0 likes · 7 min read
How Java Objects Are Created and Managed in the JVM
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 18, 2020 · Backend Development

Understanding How new String Creates Objects and the Role of the String Constant Pool in Java

This article explains why the new String("xxx") expression may create one or two objects depending on the presence of the literal in the JVM's string constant pool, demonstrates the behavior with compiled bytecode and runtime examples, and clarifies common interview misconceptions about Java string object creation.

Constant PoolJVMJava
0 likes · 12 min read
Understanding How new String Creates Objects and the Role of the String Constant Pool in Java