anrup kris

Greenhorn
+ Follow
since Oct 22, 2000
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 anrup kris

I have yet another question.
I created a servlet called My SimpleServlet.class located in
c:/tomcat/webapps/examples/web-inf/classes.
I type in a request http://localhost:8080/examples/servlet/SimpleServlet.
My server has to locate the servlet and execute the app.How the heck does it find my servlet which is sitting in c:/tomcat/.. dir ?? from the path specified in the url
I can't find any relative/absolute path to the dir listed as examples/servlet/ -->
I waded thru tomcat documentation to see if I could get anything there.
I got something to the effect that when the context is
mounted in the tomcat.conf file at the time of tomcat initialization
as in " ApJServMount /examples /root "
" all the web server paths that start with /examples go to Tomcat."
Can anyone clarify this for me??
thanx
kris
23 years ago
Thanx! it worked
kris
23 years ago
I am new to servlets and hopelessly floundering.
I downloaded Tomcat4.0 ,and I tried a HelloWorld servlet.
My problem is the jdk1.3 doesn't come with javax.servlet API,
and I dont knopw where to get it.
Where exactly do I download the class files from Sun for the servlet package. There is a servlet.jar file in Tomcat4.0 servlet api specification.Should I be including this in
C:\JDK1.3\
somebody help!!
thanks
kris
23 years ago
Hi
I got my Sun Certification recently,and I am very eager to dig into Java.I am learning servlets and Java beans now,I am looking actively for an opportunity to work in Java.
My skill set includes:
O/S :UNIX,OS/390
Languages :Java,C,HTML,DHTML,COBOL
D/B :IMS,DB2
I have 2 & 1/2 years experience in the software industry,including about 1 year of onsite experience.I will be needing a job in about 5 months from now.In the meanwhile,if our requirements match,I could acquire additional skills required by you.I will be needing H1 processing.
Any pointers or help on landing Java jobs will be much appreciated
Kris
23 years ago
I wanted to try out this javaw command.I tried running one of my classes with javaw,but nothing happens.
The javaw .exe file is present in my jdk1.2.2/bin directory.I dont get any error message but nothing executes
can anyone help?
thanx
kris
23 years ago
I am confused by the List interface.It is supposed to represent an ordered collection.But it looks like the collection is ordered
only when it is created.If I use add()method on the list,the new element is appended to the end of the list.In that case,isn't the inherent ordering of the collection lost?
I am sure I am missing something important here.Can anybody help?
thanks
kris
23 years ago
Nasir
You are right.Threads only yield to a thread of same or higher priority.The yield() method is a way to allow a thread to voluntarily give up the execution to other equal or higher priority threads especially in pre-emptive operating systemsIn non pre-emptive o/p systems,the threads will anyway be executed in round robin fashion,so that no thread gets the cpu for the entire time.
From what I understood,you are trying to use the yield() method on t1 in call() method definition.
But t1 has been defined with the lowest priority of 2.So it will anyway be getting the cpu only after t2 and t3 give up their lock on the object.
I ran your code after setting t1 and t3 to priority 5 and t2 to 10,and invoking yield on t1. The output shows that t1 runs much slower than t3,because it yields the cpu to t3,whenever t2 is sleeping and the contention is between t1 and t3 for the lock of the object.This is the only visible way I can see of demonstrating the yield() method's behaviour.

regds
kris
[This message has been edited by anrup kris (edited November 11, 2000).]
Supriya
Let's start with the static variables i,j.
You have declared them at the top,and they get default values of 0 each. Within the static block,you have again declared i,j as
int i = 2;
int j = 1;
.These are two new variables and they are effectively local to the block,and the values of 2,1 that you assign to these completely different variables are lost once the execution completes the static block.Similar reasoning for the instance variables m,n
For what you are planning,remove the "int" declaration within the static block ,likewise for the instance variables
hope this clarifies your doubt

kris
Look at your code below:


[This message has been edited by anrup kris (edited October 27, 2000).]
Congratulations!! That is a rad score!
I N V U
regards
kris
23 years ago
I read in the API that HashSet permits null values,where as the class HashTable implements a hashtable and maps keys to values.So it does not permit null values
regards
kris
None of them are keywords.
kris
I saw two questions in John Hunt's mock exam which seemed ambiguous to me
Q. 34
Which methods may cause a thread to stop executing?
a) sleep();
b) stop();
C) yield();
d) wait();
e) notify();
f) notifyAll()
g) synchronized()
Select all correct answers.

Q. 30
What class must an inner class extend:
a) The top level class
b) The Object class
c) Any class or interface
d) It must extend an interface
Select the most appropriate answer
The correct answers are :
34) a,b,c,d
30) c
My question is:
1) shouldn't the question 34 have been "Which methods may cause a thread to stop running?" instead of "Which methods may cause a thread to stop executing?"
I chose (b)
2)I thought only anonymous inner classes need to implement an interface or extend a class.The way the q is phrased,it seems like all inner classes need to implement an interface or extend a class.Is this correct?
I chose (b) because all classes indirectly extend Object class
thankx in advance for your response
kris
Thanx Sunitha and Uday for clearing my doubts.
Btw where can I find access to such info.Can you give some good online references?
thankx
-kris
For your 2nd question,I thought the answer was Window and container that contains this container
Window component has to be stand alone on the desktop,and cant be contained within another container
I think the second answer is pretty clear.
anyone has a better idea?
I found this question in a Javacaps mock paper.
1) Can anyone tell me whether anonymous classes can be created anywhere else except within a method?
2) What is the difference b/w an anonymous class and an anonymous inner class.I thought both meant the same
I had checked (a),(b) and (d). The correct answers are (a) and (d).
15. Which of the following statements are true?
A) An anonymous class cannot have any constructors
B) An anonymous class can only be created within the body of a method
C) An anonymous class can only access static fields of the enclosing class
D) An anonymous class instantiated and declared in the same place.
thanx
-kris