This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "my first java" Watch "my first java" New topic

my first java

habib bahibak

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?

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

Joined: Oct 13, 2005
Posts: 36579
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

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

Joined: Oct 13, 2005
Posts: 36579
And what was the answer?
habib bahibak

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: 13884

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 7 API documentation
Scala Notes - My blog about Scala
I agree. Here's the link:
subject: my first java
Similar Threads
question about assertion
operators question
how to compile java source code with assertion ?