Nyah Bell

Greenhorn
+ Follow
since Mar 22, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nyah Bell

Thank you SO much! Now I understand - yes! So by casting I am helping it understand what it is and what it can reach.

Thank you very very much!
11 years ago
okay sorry,

I just did not want to post up my entire actual code but I will post my actual code and go from there.



All of that was given as the teacher's code - he has said not to change it because it should work fine and the only changes we should make is adding our code where he told us to add it (as noted with the comments)

I am expected to use a stack to bind variables, but before I can do so, I need to figure out how to get to those variables. For example, in main, Expr e = new Block(new . . . . . );
e is then passed as a parameter
What can I do within the eval method to get to the variables that were instantiated in e ("x", new Declaration("x"........) etc.?

It is of course perfectly okay if you cannot help because I definitely appreciate you trying to understand me (I can be confusing) and understand what I am trying to do. This is much appreciated.
11 years ago
okay, so when it is not given a name but is just



and B is just a class with a constructor

that instance does not have a name, it is just sitting there on the right side - what would I put in the <instanceName> part? 'A' is being passed, so can I do something like:

A.B.method

??
11 years ago
well - unlike your example - there are only constructors within class A and B, so there are no return values (this is what is confusing me)

I am trying to add code to this:



the code that I need to insert is to manipulate the parameter e that is passed

in my original post, inside of main, i created


I need to get to whats inside of the instances of A and B
(almost like your example of A.methodA but when attempting this ( I am using Netbeans IDE) it is not possible to access the variables that way
11 years ago
Hi,

The following is apart of an assignment (I changed the code to be brief) and I am not posting it for my work to be done for me - I am just extremely Lost.



I am just confused as to how to handle this. Do I use something from java.io library (Scanner)? How do I handle a parameter that is just a bunch of instances??

My apologies in advance for any confusion but I am at a loss. Any help is appreciated.

Thanks in Advance
11 years ago