Gunj Agarwal

Greenhorn
+ Follow
since Jan 29, 2006
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 Gunj Agarwal

for first q? if i have another class that has a main method along with the test class then I can compile this file with test class and also run it..in that case both are not suitable......
public class poly{
public static void main(String a[]){
A ref1=new c();
B ref2=(B)ref1;
System.out.println(ref2.g());
}
}

class A{
private int f(){ return 0;}
public int g(){ return 3;}
}

class B extends A{
public int f(){ return 1;}
public int g(){ return f();}
}


class c extends B{
public int f(){ return 2;}

}

this program prints 2 but if i change the access modifier of f() in class B
to private it prints 1....whereas for anyother it prints 2...how is it being interpreted by compiler
How is that I can cast a "null" to any class but when i use instanceof for same class it returns false....
i.e..if instanceof returns true then i can cast the variable...but though instanceof returns false for "null instanceof Light" iam able to type cast it
A parent class reference can point to derived class object but vice versa is not possible.Why?

If we see acccording to memory allocated the derived class(if has more attributes) occupy more memory than parent class.So in turn the derived class covers the parent class and so shld be able to point to its object.As according to this parent class shld not be able to pt to derived's object.
If not seen according to memory also a derived class as can be said contains parent class shld be able to point to its object...can any one explain why vice versa is not possible
thanku marc...I got the point
Hi sayan,
even Iam preparing for scjp 1.5...n wld definetely like to score the highest as u want.But that requires preparation n im unable to find enough material on 1.5 to prepare.Have u got any material and mock q? for scjp1.5
why static methods cannot be overridden.A static method can be called in subclass using the class name..so why not it cant be overridden
Thanku abhishek n mark.I thought of going for SCJP1.5 and as u suggested for the book should I start reading Kathy Sierra.Iam reading Khalid n im in 4th chapter now.Had kathy sierra for scjp 1.5 come in the market and if any one have could u pls share the ebook with me.
Hi,Iam planning to write SCJP.could u pls tell me whether I shld go for 1.4 or 1.5.Iam working on java but autoboxing n such topics are new to me.Iam following Khalid Mughal for preparation.Please suggest me which exam would be better or shld i write 1.4 n then go for upgrade.Also kindly suggest me some sites which provide simulators to write online mock exams.
unavailable Exception:Initializing application data source org.apache.struts.action.DATA_SOURCE

this is the error which i encounter when im trying to connect to the Microsoft Access db.Im using weblogic to deploy my application.
I have tried connecting it using Drivermanager class which is working fine
but when im trying to use <data-source> tag in struts-config.xml file it gives this error.I think the problem is with the url specified....
18 years ago
The reset() method is called by the Struts framework with each request that uses the defined ActionForm. The purpose of this method is to reset all of the LoginForm�s data members prior to the new request values being
set. You should implement this method to reset your form�s data members to their original values; otherwise,the default implementation will do nothing.
18 years ago
iam getting this error in the log file of my application coz of wich im getting the error of cannot find actionmappings and actionbeans collection

i think my actionservlet is not getting loaded...can anyone help me with this...
18 years ago
I have included <load-on-startup> n im using weblogic,but unable to find where the logs are being written...
how do i chk whether my form is getting initialized???
18 years ago
hi,
Iam caught up with the error "Cannot find ActionMappings or ActionFormBeans collection"...I have tried all the solutions provided in the post message here...can anyone help me out..also pls can u tell me whr to find the log of the error
18 years ago