Emad Salahuddin

Greenhorn
+ Follow
since Dec 10, 2002
Merit badge: grant badges
For More
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 Emad Salahuddin

Hello Padmavathi:
Here is the link that you wanted:
http://www.ii.uib.no/~khalid/pgjc/jcbook/
Emad
Hello Alexan:
First the postfix and prefix operators are evaluated and the added together as they have higher precedence over addition.
So coming back to your question:
int x = -1;
y = x++ + ++x;
This would be evaluated as:
y = -1 + 1
y = 0
The postfix operator (x++) gets the value -1 first and then x is incremented by 1 to give 0.
The prefix operator (++x) adds 1 to x first, then uses the new value of x as the value of the expresiion.
Hope this helps.
Emad
Thanks Thomas For your help.
20 years ago
I know that if you have an abstract method, you need to declare the class as abstract as well. My question is that can a class be declared abstract without having any abstract methods in it.
Regards
Emad
20 years ago
Hello Maulin.
Thanks for your help. I used your steps 4 and 5 to compile and it worked.
Thanks Again
Emad
This is in regards to pg 63 of Kathy Sierra Book.
I have created a class Beverage in package cert.
package cert;
class Beverage {}
I have class Tea that extends class Beverage in exam.stuff package.
package exam.stuff;
import cert.Beverage;
class Tea extends Beverage{}
Both packages are in my D:\ drive.
The problem is that I don't get the following error: Tea.java:1: Can't access class cert.Beverage....(As stated in the book)
Instead I get the following:
Tea.java:3: package cert does not exist
import cert.*;
^
Tea.java:5: cannot resolve symbol
symbol : class Beverage
location: class exam.stuff.Tea
class Tea extends Beverage{}
^
2 errors
What is it that I am doing wrong? Even when I make the Beverage class public I get the same errors.
When both classes are in the same package they compile fine.
Any help will be greatly appreciated.