aspose file tools*
The moose likes Beginning Java and the fly likes Java certification question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java certification question" Watch "Java certification question" New topic
Author

Java certification question

mahesha
Greenhorn

Joined: Jul 23, 2007
Posts: 9
hi, freinds


i want to know how would we write a code in the java for this statement

the statement is ...

IN JAVA OBJECTS CANNOT CONTAIN ANOTHER OBJECT

my requirement is how to show or write a code even though this is wrong

PLEASE REPLY URGENT


Edit by mw: Removed shouting from subject line.
[ August 02, 2007: Message edited by: marc weber ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

First of all, please take some time to read the Naming Policy, and change your name accordingly. "mahesh .a mahesh" is not valid. Thank you.

Secondly, be careful not to duplicate posts :
http://www.coderanch.com/t/407785/java/java/Java-certification
http://www.coderanch.com/forums/
Writing a new topic all uppercase does not help either.

And last, please be patient. Read the following document, and you'll understand why "PLEASE REPLY URGENT" is not going to help you getting answers faster.

Thank you for your comprehension.


[My Blog]
All roads lead to JavaRanch
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
Java does have the concept of inner classes, about which there is a chapter in the Java Tutorial. Is that what you are asking about?


Ping & DNS - updated with new look and Ping home screen widget
mahesha
Greenhorn

Joined: Jul 23, 2007
Posts: 9
i know there is no inner classs but i wnt to know how the code looks like
object cannot contain other objects.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

mahesha,
thank you for changing your name, but it still does not apply to the policy. You must set both first and last names (both different). Can you please adjust it one more time ? Thank you
David McCombs
Ranch Hand

Joined: Oct 17, 2006
Posts: 212
Originally posted by mahesha:
i know there is no inner classs but i wnt to know how the code looks like
object cannot contain other objects.


What do you mean? Java has inner classes so does that qualify as objects in objects?

What about composition? Does that qualify?


"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration."- Stan Kelly-Bootle
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10925
    
  12

Originally posted by David McCombs:
What about composition? Does that qualify?

I'd say no. the object is not CONTAINED in the object. you have a reference to an object that is somewhere else.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8764
    
    5
"contained" is a suspicious word in this context, I'd say it's too subjective.

How about an array of objects? Would the array qualify as "containing" other objects?

Why do we want to know about "containment"? What's our goal here?


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Bert Bates:
"contained" is a suspicious word in this context, I'd say it's too subjective...

Agreed. We might even argue (for example) that a String "contains" the Object it's descended from.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

By the way, the topic shouts, "JAVA CERTIFICATION QUESTION." But what does this have to do with certification?
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 688

From the original posting:
IN JAVA OBJECTS CANNOT CONTAIN ANOTHER OBJECT


In Java, objects cannot contain other objects, but they can contain references to other objects. The actual objects are all in the heap.

Kaydell
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

"mahesha"

Your name still does not conform to the JavaRanch Naming Policy. Please review the policy and update it appropriately. This is your second warning.

Scott Selikoff


My Blog: Down Home Country Coding with Scott Selikoff
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Howdy Mahesha,

I think its hi time you may have to please look at your "diplay name" as our bartenders/moderators have been telling you so politely. I would suggest no matter what that should be your first plan of action!

As kaydell told, No object really "has" or "contains" another object insdie. What it matters it the posesssion of "references" to any other objects (you can even consider the reference as a handle or a pointer using which we know the way to get to an object).

Obviously, all the objects are entities residing in "Heap Memory".

Do you need to prove this concept with an example? Is that what your main question?
[ December 17, 2007: Message edited by: Raghavan Muthu ]

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Also as marc suggested, can the thread's subject be changed?

As its obviously misleading and of course that only dragged me here!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java certification question
 
Similar Threads
Java method question
How does one control the order in which methods are executed?
Jdbc Prepared Statement execute()
How to recompile .class file by Dalvik compiler in command prompt?
Connection Pooling Problem