wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes my first java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "my first java" Watch "my first java" New topic
Author

my first java

habib bahibak
Greenhorn

Joined: Feb 17, 2010
Posts: 3
int [] a=[1,2,3];
object o="123";
String t="12";
String w=t+"3";
boolean b=o.equals(a);
boolean b1=o.equals(t);
boolean b2=o.equals(w);
boolean b3=(o==w);

1-What is out put draw the result in heap and stack?
2-Explain how the code arrived at the result in b,b1,b2 and b3


help me ..
W. Joe Smith
Ranch Hand

Joined: Feb 10, 2009
Posts: 710
We have a policy here called DoYourOwnHomework. We are glad to help, but we won't do the work for you. So let me ask where are you confused? What do you know about the problem/questions? What do you think the answers are?


SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
Welcome to the Ranch

Even though the thread title is not at all helpful, I hope you don't really mean that is the first thing you have written, being expected to know what is on the stack. Please find the code button because it makes your posting easier to read.

What result did you obtain? Have you worked out why?
habib bahibak
Greenhorn

Joined: Feb 17, 2010
Posts: 3
ok thanks 4 the "nice comment",,i find the answer already,,,
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
And what was the answer?
habib bahibak
Greenhorn

Joined: Feb 17, 2010
Posts: 3
try 2 figure it out by your self?!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14190
    
  20

There is a reason why we don't give straight answers here on JavaRanch - it's because we are here to help you learn Java. You learn most by thinking about a problem yourself and finding out the answer yourself. We're happy to give you hints, but you won't learn a lot if we'd just give you the answer. See the page DoYourOwnHomework in our FAQ for more about this.

It would work much better if you'd show us what you've done yourself already and ask specific questions about where you get stuck, instead of posting your assignment here without showing that you thought about the problem yourself.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
GeeCON Prague 2014
 
subject: my first java