File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Declaration of static Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Declaration of static" Watch "Declaration of static" New topic
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
    
  13

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]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: Declaration of static
 
Similar Threads
what did i break? "no main method found"
static / non-static method overriding
static string
Static methods - overriding
Static Variable Problem