Sunitha Sounderrajan

Ranch Hand
+ Follow
since Sep 12, 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 Sunitha Sounderrajan

There is a method in HttpSession called
setMaxInactiveInterval(int interval)
Specifies the time, in seconds, between client requests before the servlet container will invalidate the session.
This relates the session to the httpsession api.
This is my understanding. Someone pls correct if i am wrong.
Thanks,
Sunitha. S
22 years ago
Thanks Selvi,
I figured it out with a lot of experimenting..
Appreciate your help.
Sunitha. S

Originally posted by selvi:
Hi ,
If you using IIS and JRun3.0 then save your class file(compiled servlet file) in c:\Allaire\JRun\servers\default\default-app\web-inf\classes. Then give http://localhost:8100/servlet/servletname in the browser.

selvi


22 years ago
Thanks for your prompt reply.
I created a directory called "mydir" under
C:\JSWDK-1.0.1\examples\servlets directory
and wrote the HelloWorld Prg in mydir directory.
I would appreciate if you could let me know whether i am right.
Thanks,
Sunitha. S

[This message has been edited by Sunitha Sounderrajan (edited November 09, 2000).]
22 years ago
Hello javaranchers,
I am a newbie to Servlets and JSP. I am SCJP2 and started learning basics of servlets. I started reading the theory and concepts from javasoft.com. I took some courage to write the traditional "HelloWorld" prg after reading some basics.
I am having problems in running my first Servlet program. I, after quite a bit of a struggle finally succeeded in compiling my first "Hello World" Servlet. But i am not able to run it.
I installed NT 4.0 in my system with option pack 4.0 which comes with IIS. I installed JRun v3.0. I also installed JSWDK-1.0.1
I set up my autoexec.bat I set the classpath to the dir in which i have the Helloworld.java. I also set the classpath for the other tools.jar and jdk1.2.2\bin.
Now i am not able to run it from Internet Explorer.
I tried giving
"http://localhost:8080/servlet/mydir/HelloWorld"
Pls help. Wish we have 9-1-1 emergency call for ignorant people like me.
Can anyone tell me what am i doing wrong. I am really stuck with this and unable to proceed.
Really appreciate any suggestion/advice on how to proceed further.
Thanks in Advance,
Sunitha. S


[This message has been edited by Sunitha Sounderrajan (edited November 09, 2000).]
22 years ago
hi,
www.javaprepare.com has some questions and tutorial section wise. This is not an actual exam but this helps when u want to analyze yourself to know how much u know in each topic. but this is alone not sufficient. This might give a good start...on basics.
hope this helps.
22 years ago
Shalini,
The "this" keyword is used inside any instance method to refer to the current object. The value "this" refers to the object which the current method has been called on. The this keyword can be used where a reference to an object of the current class type is required. Methods with the keyword static (class methods) cannot use this.
The compiler says undefined variable because this can only can be refrenced in instance methods.
Let me know if this is not clear.
Good Luck.
Sunitha. S
hi shalini,
"this" refers to the current object.
And if you say
this.n = n;
in the constructor it means u assign the instance variable n for the current object with a value passed as a parameter through the constructor.
Try the following code and play around to get a feel of constructors and "this"

The this cannot be reference in the main method directly and the compiler will say undefined variable.
Hope this helps!
Sunitha. S

[This message has been edited by Sunitha Sounderrajan (edited October 31, 2000).]
[I added UBB CODE tags to your source code to make it more readable. Please try to use
them in the future. Learn more about UBB codes here - Ajith ]

[This message has been edited by Ajith Kallambella (edited October 31, 2000).]
Hi everybody,
Thanks for your wishes.
Well, i just got one question which said something like what is the result closest to ..something. and i thought there were 2 answers which were real close.. and i had to choose from them?? i got this question right bcos i got 100% in this section
Coming to memorizing...i did it in IO ONLY. i did not have a lot of exposure in working with Streams and file handling. that is why i had to.
I followed RHE and it is not at all enough for the IO classes and util. I followed a Reference book Complete Reference to Java 2 by Patrick Naughton. This book lists the Class and the constructors and a brief description. Understanding of which are character streams and byte streams helps in understanding the code questions in IO. Also it is better to which are abstract classes and keep in mind that we cannot instantiate an obj with abstract classes!!
I was blindly on the impression that IO classes will not have code questions and it might be like the choosing the valid constructors..My Assumption was wrong!!

Coming to the Thread questions:
Not all questions were lengthier codes. I had 3 questions which had 8-10 lines of code and 1 general question about the thread method.. and the rest were lengthier codes. It would help if there is a complete understanding of synchronized block of codes and how wait and notify work on that..
AWT : I did not find these questions tough. One has to have an understanding of different layout's behaviour and the different events and which component fires which event etc...
Collection questions were like which class implements which interface etc!!! collections and IO the list is endless..this was the place i lost most of my marks..
hope this info helps.
Thanks again for the wishes. Will be hanging around in this forum for a while..to learn some more java.

Sunitha. S


[This message has been edited by Sunitha Sounderrajan (edited October 31, 2000).]
Hi javaranchers,
I took my SCJP exam today and passed. I did not pass with some outstanding score like many people do. But i am really relieved from the tension.!!
About the exam :
The exam was not tricky at all. The questions were well phrased and pretty straight forward. I finished the exam in one hour and had 30 minutes to review and i had big thread questions to be done at last. there were 4 questions each on an average had 28-30 lines of code!
One has to write,write and write loads and loads of code and practice to understand the language. That really helps a lot wrt understanding the code. Donot be afraid of the compiler scoldings...!!! Just try and change the code and look for all the possibilities in which the code can be written.
The breakage in the questions :
Threads 7 questions
IO -- 6 questions
java.util - 3
java.lang - 4
GC -- 1
AWT - 5
Inner classes and Anonymous classes -- 3
and lots on language fundementals, exception handling, declaration and access control, overloading and overriding.
only 10% of the questions were like short answer type questions. most of the questions had more than one answer and the question states that select the best possible answer.
The thread questions were the toughest..i got only 57% in Threads. The wait() notify() really killed me..!!!
inorder to score well in IO it is definitely necessary to know the constructors very well.
Hope this helps. I learnt a lot from javaranch forum and really thank all of them who take pains to help us get certified. I should say that i got really addicted to this site.!!!

Good luck for all the future SCJP's.
Sunitha. S


[This message has been edited by Sunitha Sounderrajan (edited October 31, 2000).]
hi anrup,
1) Can anyone tell me whether anonymous classes can be created anywhere else except within a method?
--> Anonymous classes can be created in static/instance floating blocks also.
import java.awt.event.*;
public class Sample{
static {
ActionListener al = new ActionListener() {
System.out.println("I am in ActionListener!!");
}
public void actionPerformed(ActionEvent e) { System.out.println("Taking care of ActionEvent..");
}
};
}
public static void main(String[] args) {
new Sample();
}
}
Hope this helps.
hello Preyas,
replace(oldchar, newchar)
--> returns a new string, generated by replacing every occurance of oldchar with newchar. If there is nothing to replace then the returned string is NOT a new string. it returns the same string. No new string is returned.
For Example-1.
if ("sample".replace('s', 'S') == "Sample")
System.out.println("No new Strings returned");
else
System.out.println("New Strings returned");
In Example-1 displays "New Strings returned".
Example-2.
if ("Sample".replace('s', 'S') == "Sample")
System.out.println("No new Strings returned");
else
System.out.println("New Strings returned");
In Example-2 displays "No new Strings returned".
In case of trim() the same rules holds good.
if (" Sample ".trim() == "Sample")
System.out.println("No new Strings");
else
System.out.println("New Strings");

--> displays "New Strings"
if ("Sample".trim() == "Sample")
System.out.println("No new Strings");
else
System.out.println("New Strings");
--> displays "No new Strings"

Hope this helps.
Sunitha. S

[This message has been edited by Sunitha Sounderrajan (edited October 21, 2000).]
Thanks bunches Paul and Zulfiqar. Appreciate your prompt reply.
Sunitha. S
hi all,
I want to know how to determine whether a given relationship falls under "is a " or "has a " relationship.
I know when we use extends to extend from a class then it falls under "is a " relationship. i am confused with interface relations especially.
Sorry if it is too basic/beginner question. Can someone explain pls?
Thanks in advance.
Sunitha. S
Congratulations on your success! Good to know that you are a SCJP2 now! All the best for your future ventures!
Sunitha. S

[This message has been edited by Sunitha Sounderrajan (edited October 18, 2000).]
Hi roopesh,
Shall try to answer your questions.
1. Will real exam be very tough than the mocks?
-- Well, the real exam will cover the same objectives as the mock exams. So, it is sufficient if you are clear with the objectives and have written sample codes and understood the concepts clearly. My opinion is Theoritical knowledge alone is just NOT enough to pass the certification exam.
2. Collection and IO is a large topic. Having MANY classes and methods which are difficult to remember. Do they ask on class constructors ? and method signatures of IO and Collection ? I think then it would be difficult.
-- Yes, u are right. It has Many classes and methods which has to be remembered. especially IO Classes. Yes, the exam asks questions on different forms of Constructors and methods. This comes by practice by writing lots of code and reading the methods and constructor signatures repeatedly. !
Eg: Identify the FileInputStream Constructors from the following:
FileInputStream(RandomAccessFile RAF);
FileImputStream(InputStream stream);
FileInputStream(DataOutputStream Dout);
FileInputStream(String str);
I am just giving an example.
3. AWT also has many components. What type of questions would be there on AWT?
some of the questions AWT questions will be like what is the output ? one has to read the code and visualise how the output will look like. Need to have a good understanding on the Layout Manager concepts.
4. What about GridBagLayout and card layout? RHE doesnot explain that. Are questions asked on that?
--almost Everyone who attended the exam say that they get atleast one qstn from GridBagLayout. It is better to read about GridBagLayout and GridBagConstraints especially.

Hope this helps.! Good luck in your exam.
Sunitha. S