This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

zhang feng

Greenhorn
+ Follow
since Dec 16, 2002
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 zhang feng

I reload my context in tomcat.
My servlet example is:
public class MyThread extends Thread{
.........

}
public class MyServlet extends HttpServlet{

public void init(){

........
MyThread thread = new MyThread();
thread.start();
.........
}
}

when i reload this at manager page,two MyThread thread will run. The first create thread dont stop.I call thread.setDaemon(true),it cannt stop the first MyThread also.
How run only one MyThread when i reload the context.
13 years ago
perhaps i have a little error,but the ObjectInputStream.GetField used to where?
[ November 12, 2003: Message edited by: zhang feng ]
16 years ago
hello , i think to receive the Object's data from the server,eg:


up the "ss" is a InputStream of the Sock stream,"MyObject" is my owner class. the "name" is my class's int field.so i through the one way can read
the right data to "name" from the server.now i think that read the object's data in the server ,that passed the ObjectInputStream.GetFields object "osg" in the two way ,if this has or not the cemment //1 ,it always throws the NotActiveException :not in call to readObject() at //2.sever use the same compute.
now how can i do?
thank you help!
16 years ago
ou,sorry,used to Practice JAVA only indicated my idea that is not method lock.I think that it's two synchronized form,and other nothing.
I beg your pardon.Perheps my expression is not very clearly,my english is not very well.
thanks your help .
[ October 15, 2003: Message edited by: zhang feng ]
Ernest Friedman-Hill :
you tell me what I think , your means the sub-class include the all the parent class data(unprivate) and point to super-class method pointer.Althougth the sub-class extends the super class ,sub-class invoke the super-class's(not interface and abstract class) synchronized method,only received the sub-class lock,and not super-class.if the up eg,the BaseClass is not abstract,at the comment //1 ,only one myclass1 object,the lock is myclass1 object's.
i right ?
In the book Practice JAVA ,the author introduce the two synchronized way,used to the method and block.it's not say a method lock,only the object has lock.
used two the ways ,only the efficience is not same , and synchronized method will aware the higher efficience.
every object has a lock,but consided the "abstract" class,that isn't instance,if it has a synchronized method ,i invoked the method from the driver class,i will receive the which locks?
the following class indicate my means:

i invoke the BaseClass f() and g(),here,i will have a lock,is Myclass's object my1,my2?i think that have two locks,but i don't know that the my1 lock and my2 lock associate the BaseClass?thus,if i reveive the BaseClass's locks?why ?
thanks your help !
[ October 09, 2003: Message edited by: zhang feng ]
[ October 09, 2003: Message edited by: zhang feng ]
the object has a lock,but consided the "abstract" class,that isn't instance,if it has a synchronized method ,i invoked the method from the driver class,i will receive the which locks?
the following class indicate my means:

at 1,i invoke the BaseClass f(),here,i will which lock,is Myclass's object?
why ?
thanks your help !
16 years ago
reply yes
let's write fellow class


Guess output what?
true
false
false
[1,2,3]
Set's add() method that will return boolean value , show the object if add successful
i understand this way
i think that the object added the set pass the first reference,before add that pass the object's other reference ,so the objectself cannt the into the set pass the second reference
[ September 07, 2003: Message edited by: zhang feng ]
oh,it`s right ,thank you!!!
17 years ago
sorry ,here is a little wrong!
now i repaired myclass.
your means are the JVM will find the subclass method ,if don`t find.
type will be auto to casttype,find parent method!
In the first code , the method fun() called in the main(),because JVM don`t find sample arguement's fun() in the subclass method,cast be auto, the type
cast to higher.but the parent class method's fun() arguement sample in the main() called. now the JVM don`t know invoke which an indeed fun();
r u means?
17 years ago
i have two class below

Now, i compile the class ,but it`s not correct!
i change the class below

it`s run good ,but i dont know why?
thanks for u help!
[ August 03, 2003: Message edited by: zhang feng ]
17 years ago
i have a class

i dont understand , c++ will print 1; java print 0;
java development from c++ ,why the statement(i=i++)
print 0,and not 1;
17 years ago
oh,it's running good ,thank you
17 years ago
i have a three .java files followed:

when i compiling the LittleDog,show the WhiteDog() has protected access in the myclass2.Dog.WhiteDog
How can I access the WhiteDog in the LittleDog.java
[ June 11, 2003: Message edited by: zhang feng ]
[ June 11, 2003: Message edited by: zhang feng ]
17 years ago
thank you! my class work good for your method.
But i don't know that the class don't run at . path;
as you say ,i have two class at class/mypackage

i use "java mypackage.myclass2 run the myclass2.class at class/mypackaye
it run good;
but i repalce the "package mypackage;" to "package mypackage1;" ,the myclass1 compile good ,the myclass2 don't compile.
the compile-operator don't creat the directory itself?
thank you very much!
17 years ago