| Author |
Declaration of static
|
leela mohan
Greenhorn
Joined: Oct 31, 2006
Posts: 13
|
|
Suppose i declare static method in servletclass in that method i want print "hi" it is possible or not ? static method can also call by classname so please tell me answer
|
 |
Rahul Bhattacharjee
Ranch Hand
Joined: Nov 29, 2005
Posts: 2300
|
|
|
yes , servletname.methodname()
|
Rahul Bhattacharjee
LinkedIn - Blog
|
 |
Prabhu Venkatachalam
Ranch Hand
Joined: Nov 16, 2005
Posts: 502
|
|
|
nothing will stop you in declaring static methods in servlet class. But what is the need in writing static method in servlet? can you explain us little bit about your requirement?
|
Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
|
 |
Chaitanya Devavarapu
Greenhorn
Joined: Dec 06, 2006
Posts: 19
|
|
You can do it absolutely. But, why need to declare a static method in servlet. If you can tell your exact requirement, I can choose an appropriate solution. bye.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56177
|
|
You can hit yourself in the middle of the forehead with a ball-peen hammer too. Static methods have their uses, but you have not explained why you would want to do this. Chances are there are better means.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Declaration of static
|
|
|