Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

my first java

 
habib bahibak
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Campbell Ritchie
Sheriff
Pie
Posts: 48972
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks 4 the "nice comment",,i find the answer already,,,
 
Campbell Ritchie
Sheriff
Pie
Posts: 48972
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what was the answer?
 
habib bahibak
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try 2 figure it out by your self?!
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15284
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic