i m harpreet here...i m employee of software company. i m trying to import own class in servlet class.i m unable to use own class in servlet class........plz help
Submitted by Anonymous on Fri, 03/06/2009 - 09:34.
If you are unable to import your own class then let someone else write that class for you then you can import(because u have problem with your OWN class and now class is written by someone else).
Submitted by Anonymous on Sun, 06/07/2009 - 13:59.
for(int i=1;i<=5;i++)
{
System.out.println("\t from thread A:i="+i);
}
System.out.println("exit from A");
}
}
class B implements Runnable
{
public void run()
{
for(int j=1;j<=5;j++)
{
System.out.println("\t from thread B:j="+j);
}
System.out.println("exit from B");
}
}
class C implements Runnable
{
public void run()
{
for(int k=1;k<=5;k++)
{
System.out.println("\t from thread C:k="+k);
}
System.out.println("exit from C");
}
}
public class Threadcreation
{
public static void main(String args[])
{
A threadA=new A();
B threadB=new B();
C threadC=new C();
threadA.start();
threadB.start();
threadC.start();
}
}
GETTING AN ERROR:
CANNOT RESOLVE SYMBOL
threadA.START();
Submitted by Anonymous on Sat, 06/13/2009 - 12:33.
I'm not sure why when running the sample code the higher priority thread seems slower to count, because I would have expected it to work the other way round, intuitively...
Submitted by Anonymous on Tue, 09/22/2009 - 23:32.
i got confused with terms extending and implementing classes and interfaces..(>_<;)
i didn't understand a thing about using interfaces and their difference in extending a class..may god help me..
Submitted by Anonymous on Fri, 09/25/2009 - 13:52.
That's a nice tutorial for everybody who needs to refresh their knowledge in Java. Beginners should read and understand the concepts of object oriented language... that's sure!
Please post relevant
Please post relevant compiler or runtime errors.
related to servlet
Can you please elaborate a little.
Are you recieving any err or NPE ?
related to servlet
If you are unable to import your own class then let someone else write that class for you then you can import(because u have problem with your OWN class and now class is written by someone else).
If someone else writes that
If someone else writes that class. Then it becomes private to him.
Now you can use that class in your servlet.
You are not able to use your class because your class does not like to sit in your own servlet.
voov im becoming intelligent....
try this
write class in a separate file
use absloute address technique
try to import that class into your current class file
plaese solve
for(int i=1;i<=5;i++)
{
System.out.println("\t from thread A:i="+i);
}
System.out.println("exit from A");
}
}
class B implements Runnable
{
public void run()
{
for(int j=1;j<=5;j++)
{
System.out.println("\t from thread B:j="+j);
}
System.out.println("exit from B");
}
}
class C implements Runnable
{
public void run()
{
for(int k=1;k<=5;k++)
{
System.out.println("\t from thread C:k="+k);
}
System.out.println("exit from C");
}
}
public class Threadcreation
{
public static void main(String args[])
{
A threadA=new A();
B threadB=new B();
C threadC=new C();
threadA.start();
threadB.start();
threadC.start();
}
}
GETTING AN ERROR:
CANNOT RESOLVE SYMBOL
threadA.START();
threadA is not a thread,
threadA is not a thread, it's an "A" object.
Try renaming threadA, threadB, and threadC to
objA, objB, objC
then,
Thread threadA = new Thread(objA);
Thread threadB = new Thread(objB);
Thread threadC = new Thread(objC);
Then you can do the .start() methods
I'm not sure why when running the sample code the higher priorit
I'm not sure why when running the sample code the higher priority thread seems slower to count, because I would have expected it to work the other way round, intuitively...
i want thred examle program
i want thred examle program
extends who and implements what
i got confused with terms extending and implementing classes and interfaces..(>_<;)
i didn't understand a thing about using interfaces and their difference in extending a class..may god help me..
java thread
can ne one suggest good reference site/book for java thread.
nice
That's a nice tutorial for everybody who needs to refresh their knowledge in Java. Beginners should read and understand the concepts of object oriented language... that's sure!
Little nitpick
Did you guys actually capitalize an instance variable in that example? (int Count) I'm ashamed and appalled good sirs!
counting alive threads
Can you suggest a way for finding out the number of alive threads in a program..
using isAlive() method of thread you can find out the no of aliv
using isAlive() method of thread you can find out the no of alive threads in program...
Java threads reference
http://www.roseindia.net/java/beginners/Threads.shtml
else contact me
mohammadbilal.shaikh@gmail.com
Post new comment