Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

import jar file in servlet

 
Suka Hati
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I have a question.
In a servlet if we want to call a jar file we should import it.
Eg. import test.*;

if we want to use a class in that jar file, the way we call it is :

Try try = new Try();

and calling method in that class:

try.callSentence();

What if we want to initialize it. How to do this?Is the below code right?

Try try = new Try(1,2);
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try try = new Try(1,2);


It would be correct if the Try class defines a constructor with 2 int (or..) parameters. Are you facing any problems?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic