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 7597611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:11:55+00:00 2026-05-30T22:11:55+00:00

I have a problem in understanding OOP… This is it : Sometime’s you create

  • 0

I have a problem in understanding OOP…
This is it :

Sometime’s you create an object with this syntax:

Object ObjectName = new Object();

But sometimes, we don’t need to do that like in Android:

Textview TextviewName;

Or in J2ME:

form formName;

I already searched it and I got some information (but not sure) that this is because of static method… is it true? I think it has a relation with Polymorphism.. is it true?
Thanks all.

PS : Sory if I made some mistakes, English is not my native languange 😀

  • 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-30T22:11:57+00:00Added an answer on May 30, 2026 at 10:11 pm

    Forget static methods – they’re not relevant here. I’d advocate only looking at static methods / elements when you’ve truly grasped what objects are.

    In Java, you can do this:

    Object object;
    

    Just as well as you can do this:

    Object object = new Object();
    

    In the first example, you’re creating a reference but you’re not populating that reference with anything, in the second example you’re creating a reference and populating it with a new object, on which you can call methods, modify values and so on.

    If you try and call methods on the first declaration you won’t be able to – there’s nothing there. Depending on the language and how you’ve declared it this might produce an error at runtime or a compile time error (Java does both depending on whether it’s a field or a local variable.) The principle though is the same for all OO languages, you can’t dereference (call methods, fields, etc.) on a reference that hasn’t been populated, because in effect you’re trying to call a method on something that isn’t there.

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

Sidebar

Related Questions

I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I'm not sure how to describe this best. But I have a problem understanding
I have a problem with understanding of some basic OOP concepts. I'll try to
I have problem understanding the meaning of join in the following case: Thread t1=new
Basically I'm rather new to Java and I have a problem with understanding a
I have this problem understanding how to save data in order to have an
I have problem understanding the order in which initialization happens. this is the order
I have problem understanding this one: <?php $string = 'April 15, 2003'; $pattern =
I seem to have a problem understanding how to conditionally test a boolean value
I think I have a problem in understanding the proper way of using MVC.

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.