Tagged articles
39 articles
Page 1 of 1
Java Architect Handbook
Java Architect Handbook
Mar 12, 2026 · Backend Development

How Many Objects Does new String("abc") Actually Create?

This article explains why the interview question "String str = new String(\"abc\")" can create either one or two objects depending on JVM string pool state, detailing the JVM memory model, string pool mechanics, code examples, best practices, and common misconceptions.

JVMMemory ManagementObject Creation
0 likes · 9 min read
How Many Objects Does new String("abc") Actually Create?
Top Architect
Top Architect
Nov 24, 2025 · Fundamentals

How Many Objects Does a Java String Create? Literal vs new String Explained

This article breaks down the exact number of objects created when using a string literal versus the new String constructor in Java, detailing interactions with the constant pool, stack, and heap, and demonstrates the resulting reference comparisons with concrete code examples.

JVMMemory ManagementObject Creation
0 likes · 5 min read
How Many Objects Does a Java String Create? Literal vs new String Explained
Architect's Tech Stack
Architect's Tech Stack
Jul 24, 2025 · Backend Development

Why Is Reflection So Much Slower Than new? Java Object Creation Benchmarks

This article explains the fundamental differences between using the new operator and Java reflection to instantiate objects, presents a performance benchmark showing reflection’s significant overhead, analyzes the underlying reasons, and outlines practical scenarios where each approach is appropriate.

Object CreationReflectionbenchmark
0 likes · 5 min read
Why Is Reflection So Much Slower Than new? Java Object Creation Benchmarks
Java Architect Essentials
Java Architect Essentials
Jul 21, 2025 · Backend Development

Boost Java Object Creation Speed: 3 Proven Techniques to Cut Overhead

This article explains why using the plain new operator is far faster than reflection, shows how an object pool can dramatically reduce memory usage and allocation time, and demonstrates a factory‑plus‑cache pattern that eliminates most repetitive new calls, delivering up to three‑fold performance gains.

BackendFactory PatternObject Creation
0 likes · 6 min read
Boost Java Object Creation Speed: 3 Proven Techniques to Cut Overhead
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.

Object CreationReflectionbackend-development
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 PoolMemory ManagementObject Creation
0 likes · 3 min read
How Many Objects Does Java Create for Different String Initializations?
Java High-Performance Architecture
Java High-Performance Architecture
Oct 5, 2023 · Backend Development

Why Reflection Slows Down Java Object Creation: New vs Reflective Instantiation

This article compares creating Java objects with the new operator and with reflection, presents benchmark code showing a huge performance gap, explains the underlying reasons such as JIT optimization limits and Method#invoke overhead, and outlines practical scenarios for using each approach.

Object CreationReflectionbackend-development
0 likes · 5 min read
Why Reflection Slows Down Java Object Creation: New vs Reflective Instantiation
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.

JVMMemory ManagementObject Creation
0 likes · 11 min read
Understanding Java Object Creation, JVM Memory, and Class Loading
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 PatternObject Creation
0 likes · 6 min read
Understanding the Builder Design Pattern with Java Examples
Su San Talks Tech
Su San Talks Tech
Aug 23, 2023 · Fundamentals

Why Does JVM Allocate Objects in Multiple Steps? Explore Creation & Memory Layout

This article explains the JVM's object creation process—including stack allocation, TLAB checks, Eden and Survivor spaces, and GC handling—and details the memory layout of Java objects, covering object headers, class pointers, array lengths, padding, and the effect of compressed oops on 32‑bit versus 64‑bit systems.

Garbage CollectionJVMObject Creation
0 likes · 9 min read
Why Does JVM Allocate Objects in Multiple Steps? Explore Creation & Memory Layout
Selected Java Interview Questions
Selected Java Interview Questions
Apr 7, 2023 · Backend Development

Understanding Object Creation in Java: How Many Objects Are Created by `String s = new String("xyz")`?

This article explains the evolution of the Java method area, analyzes bytecode generated by `String s = new String("xyz")` and `String s = "xyz"`, and clarifies why the expression creates one or two objects depending on whether the literal already exists in the constant pool.

BackendConstant PoolObject Creation
0 likes · 7 min read
Understanding Object Creation in Java: How Many Objects Are Created by `String s = new String("xyz")`?
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 PoolMemory ManagementObject Creation
0 likes · 5 min read
Understanding Java String Object Creation and Memory Allocation
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 PatternFunctional InterfacesGeneric Builder
0 likes · 8 min read
A Generic Builder Pattern for Simplifying Java Object Creation
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 ExampleObject CreationStatic Factory
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.

LombokObject CreationReflection
0 likes · 7 min read
Six Ways to Create Objects in Java
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 16, 2021 · Fundamentals

Builder Design Pattern: Introduction, UML Diagram, Java Implementation, Use Cases, Advantages and Disadvantages

This article introduces the Builder design pattern, explains its role in separating object construction from representation, provides UML class diagrams and Java code examples, outlines typical application scenarios, and discusses its advantages and disadvantages.

Builder PatternDesign PatternsObject Creation
0 likes · 5 min read
Builder Design Pattern: Introduction, UML Diagram, Java Implementation, Use Cases, Advantages and Disadvantages
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 PatternsObject Creation
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.

DeserializationObject CreationReflection
0 likes · 8 min read
Various Ways to Create Objects in Java: new, newInstance, Reflection, Cloning, and Deserialization
Programmer DD
Programmer DD
Oct 30, 2020 · Backend Development

5 Ways to Create Java Objects: From new Keyword to Deserialization

This article explains five core techniques for instantiating Java objects—including the new keyword, Class.newInstance(), Constructor.newInstance(), clone(), and deserialization—provides code examples for each method, and demonstrates their usage in a complete program with sample output.

Object CreationReflectionclone
0 likes · 8 min read
5 Ways to Create Java Objects: From new Keyword to 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.

Object CreationObjective‑CRuntime
0 likes · 11 min read
Understanding the Object Creation Process in Objective‑C
Programmer DD
Programmer DD
Aug 17, 2020 · Fundamentals

JVM Object Creation: Memory Allocation, Layout, and Access Explained

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

JVMObject CreationObject Layout
0 likes · 7 min read
JVM Object Creation: Memory Allocation, Layout, and Access Explained
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.

JVMObject CreationThread Local Allocation Buffer
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 PoolJVMObject Creation
0 likes · 12 min read
Understanding How new String Creates Objects and the Role of the String Constant Pool in Java
Senior Brother's Insights
Senior Brother's Insights
Nov 12, 2019 · Fundamentals

What Really Happens When Java Loads a Class and Creates an Object?

When Java executes a new expression, the JVM first ensures the class is loaded using the parent‑delegation model, then follows a five‑step loading and linking process before allocating heap memory, initializing fields, running static and instance code, and finally returning a reference to the new object.

InitializationJVMObject Creation
0 likes · 8 min read
What Really Happens When Java Loads a Class and Creates an Object?
Java Captain
Java Captain
Oct 3, 2019 · Fundamentals

Java Class Loading and Object Creation Process

This article explains the Java Virtual Machine's class loading mechanism—including loading, verification, preparation, resolution, and initialization—and details how objects are created in memory, covering heap allocation, default values, instance initialization, and reference handling.

Object Creationclass-loading
0 likes · 6 min read
Java Class Loading and Object Creation Process
Java Captain
Java Captain
May 27, 2019 · Fundamentals

Java Runtime Memory Areas, Object Creation, and Common Interview Questions

This article explains Java's runtime memory regions, including the program counter, stacks, heap, method area, constant pool, and direct memory, and details the HotSpot object creation process, memory layout, access mechanisms, as well as String and wrapper class behaviors, providing essential knowledge for Java interview preparation.

Interview PreparationJVMMemory Management
0 likes · 19 min read
Java Runtime Memory Areas, Object Creation, and Common Interview Questions
Java Captain
Java Captain
Jun 10, 2018 · Fundamentals

Detailed Explanation of Java Object Creation and Initialization Process

This article provides an in‑depth overview of how Java objects are created and initialized, covering class loading, the various ways to instantiate objects (new, reflection, clone, deserialization), the step‑by‑step memory allocation and field initialization sequence, and the order of static and instance initialization across inheritance hierarchies.

InitializationJVMObject Creation
0 likes · 16 min read
Detailed Explanation of Java Object Creation and Initialization Process
Java Captain
Java Captain
Sep 26, 2017 · Backend Development

Five Ways to Create Objects in Java and Their Bytecode

This article explains five Java object‑creation techniques—using the new keyword, Class.newInstance, Constructor.newInstance, clone, and deserialization—shows their bytecode differences, provides a complete Employee example, and demonstrates each method with runnable code and output.

DeserializationObject CreationReflection
0 likes · 8 min read
Five Ways to Create Objects in Java and Their Bytecode
Aotu Lab
Aotu Lab
Apr 15, 2016 · Frontend Development

Master Clean JavaScript: Coding Style, Variables, Error Handling, and Design Patterns

This article provides a comprehensive guide to writing maintainable JavaScript, covering coding conventions, variable best practices, error handling techniques, object creation methods, prototype and module patterns, and practical examples to help developers build clean, modular, and loosely‑coupled code.

Design PatternsError HandlingJavaScript
0 likes · 16 min read
Master Clean JavaScript: Coding Style, Variables, Error Handling, and Design Patterns
21CTO
21CTO
Jan 29, 2016 · Backend Development

How to Create a PHP Extension Object: Step‑by‑Step Guide

This tutorial walks through creating a PHP extension object by defining a zend_class_entry, naming the class, registering it, declaring properties, and implementing methods, complete with full example code and a PHP usage snippet.

ExtensionObject CreationPHP
0 likes · 4 min read
How to Create a PHP Extension Object: Step‑by‑Step Guide