Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Oren Ben

Greenhorn
+ Follow
since Nov 19, 2008
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 Oren Ben

you should add the "jsp-api.jar" to your CLASSPATH
that's my problem
seems like there is missing code

the book gives the following code :


<div class="tipBox'>
<b>Tip of the Day:</b><br/><br/>
${pageContent.currentTip}
</div>


and the output :

Tip of the Day:
Wash your hair every other day.


my question is : how should i get their output?
the ${pageContent.currentTip} should give me the sentence "Wash your hair every other day." but how? what's the code for that?

thanks
Oren
Hi All

i put the following code in jsp file :

<html><body>
<div class="tipBox'>
<b>Tip of the Day:</b><br/><br/>
${pageContent.currentTip}
</div>
</body></html>

How do i get to the following example output :

Tip of the Day:
Wash your hair every other day.

thanks
Oren


">
Thanks Man , now i understand it all
thanks All for your replies

thanks James for your static point that i missed and it is really important .

but what about the 2 Beta Objects with it's 2 references b1, b2.

Beta b1 = new Beta(); Beta b2 = new Beta();

why aren't they called Objects?
(lets put the Alpha class issue a side )
Hi All

i hope someone could help me with the following question


class Beta {}

class Alpha {
static Beta b1;
Beta b2;
}

public class Tester {
public static void main (String [] args){

Beta b1 = new Beta(); Beta b2 = new Beta();
Alpha a1 = new Alpha(); Alpha a2 = new Alpha();
a1.b1=b1;
a1.b2=b1;
a2.b2=b2;
a1=null; b1=null; b2=null;
// line 16 --do stuff

}
}

the Question is : When line 16 is reached . how many objects will be eligible for garbage collection ?

The Answer is 1 .

===================================================================

i personlly see more than 1 object that is eligible for GC
for example : b2 , b1
Why am i wrong ? can someone please explain me the answer for that question?