Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 813905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:26:06+00:00 2026-05-15T01:26:06+00:00

is declaring/initializing primitives the same as creating new objects? from what i know when

  • 0

is declaring/initializing primitives the same as creating new objects? from what i know when we create primitives, we also creating wrapper classes for them. im implementing on java btw.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:26:06+00:00Added an answer on May 15, 2026 at 1:26 am

    No, assigning primitive values does not create any objects.

    What you might be referring to is the fact that primitive values can be auto-boxed into the corresponding wrappers, when they are used in a context where a reference type (a.k.a “an object”) is required:

    int i = 13;     // this line does not create an object
    Integer i2 = i; // at this line 13 is auto-boxed into an Integer object
    
    char c = 'x';   // again: no object created:
    List<Character> l = new ArrayList<Character>();
    l.add(c);       // c is auto-boxed into a Character object
    

    Also, I’ll try to describe the difference between declare and initialize:

    int i;          // an int-variable is declared
    int j = 0;      // an int-variable is declared and initialized
    i = 1;          // an int-variable is assigned a value, this is *not* initialization
    

    A variable is “declared” when it is created for the first time (i.e. you specify the type and name of the variable). It is initialized when it’s assigned a value during declaration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi all i am declaring id and class when creating table dynamically as below
So I'm declaring and initializing an int array: static final int UN = 0;
Consider the following ways of declaring and initializing a variable of type C :
When declaring primitives does it matter if I use the assignment operator or copy
EDIT: declaring them private was a typo, I fixed it: Relating to another question,
Is declaring extern const or just extern the same thing in a header file?
Is there a way declaring new static variables outside of that class even if
Can you give any reasonable example for a ArrayList<ArrayList<E>> , such as declaring, initializing,
How do you create a global array of strings? I have tried declaring a
When declaring a class that inherits from a specific class: class C(dict): added_attribute =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.