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

Daniel

Greenhorn
+ Follow
since Dec 01, 2000
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 Daniel

Congrats Zhang Ye!!
Could you also send me that text file? I would be really grateful if you could send it to me! My email address is
lu_ussmc@yahoo.com
Thanks!
Lu
21 years ago
Interface is Java's solution for mutiple inheritances. Unlike C++, Java doesn't support multiple inheritance.
Abstract class is like a template for other classes. No objects can be created from an abstract classes.
I'd recommend Core Java or Just Java if you want to learn more.
Daniel
I spent about 2 months preparing for the exam. The reference books I used were Core Java, RHE, Exam Cram and JLS.
First, I studied Core Java Volume I and the first two chapters of Volume 2. Then 2 weeks before the exam, I studied RHE and Exam Cram. I only refered to JLS when I was getting conflicting information from different sources.
Meanwhile, I took almost all the mock exams in JavaRanch's list (Thanks! JavaRanch). I did lots of testing on my own machine. Some of the concepts or ideas will be much more understandable if you learn them through pratice.
Hope this helps and enjoy your learning!
Daniel

What I think choice b is crrect too because the default priority value is NORM_PRIORITY
Given the following code, which statements concerning the objects referenced through the member variables i, j and k are true, given that any thread may call the methods a, b and c at any time?
class Counter {
int v = 0;
synchronized void inc() { v++; }
synchronized void dec() { v--; }
}
public class Q7ed5 {
Counter i;
Counter j;
Counter k;
public synchronized void a() {
i.inc();
System.out.println("a");
i.dec();
}
public synchronized void b() {
i.inc(); j.inc(); k.inc();
System.out.println("b");
i.dec(); j.dec(); k.dec();
}
public void c() {
k.inc();
System.out.println("c");
k.dec();
}
}
Select all valid answers
1. i.v is guaranteed always to be or 1.
2. j.v is guaranteed always to be or 1.
3. k.v is guaranteed always to be or 1.
4. j.v will always be greater than or equal to k.v at any given time.
5. k.v will always be greater than or equal to j.v at any given time.
It looks like for every method in the class String with form
String method()
the following property holds:
If method returns a string which satisfies
that the value of s.method().equals(s) is true,
s.method() == s is also true.
in the other word, if s.method() DOES NOT CHANGE the content of s, THEN s.method() returns itself.
For example:
String s = "s";
s == s.toUpperCase();
s == s.concat(new String())
....

Originally posted by kevin jia:
Hi, carl
If you try the code below, you will change your conclusion.
class Test0 {
public static void main(String args[]) {
String a = new String("AAA");
String b = new String("bbb");
System.out.println(a == a.toUpperCase());
System.out.println(b == b.toLowerCase());
}
}
The answer is " true, true ".


Originally posted by Steven YaegerII:
This probally isn't necessary, but is your browser java enabled? In Netscape, click edit, preferences, and then advanced (not the + sign by the word but the word itself). From there you can enable the browser to use java and other things. I'm not familiar with Internet Explorer.


Yes, my browsers(both NS and IE) are java enabled. Are there any other possible reasons which cost it?
21 years ago
Can any one over there tell me how to play "Rules Roundup game"?
The problem I meet is that after my clicking either "Play it now"
or "Rules Roundup game", there is a large empty area on window
where I guess the applet should be. I do not have any clue to
why it is. Any hint, any help???
D. Liu
21 years ago
Can any one over there tell me how to play "Rules Roundup game"?
The problem I meet is that after my clicking either "Play it now"
or "Rules Roundup game", there is a large empty area on window
where I guess the applet should be. I do not have any clue to
why it is. Any hint, any help???
D. Liu