Mathew Chen

Greenhorn
+ Follow
since Aug 01, 2005
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 Mathew Chen

How about this example?

public class ClassA1 {
public void foo(){
System.out.println("Test A");
}

}

/////////////////////

public class ClassB1 extends ClassA1 {
public void foo(){
System.out.println("Print B");
}

}

///////////////////////

public class TestA1B1 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
ClassB1 B1=new ClassB1();
ClassA1 A1 = (ClassA1) B1;
A1.foo();

}

}

The above application when run prints "Print B".What is the conceptual reason for this?I know this is pretty simple stuff for you guys.

Thanks
Mathew Chen
18 years ago
Hi,
I am kinda confused about upcasting in Java?I thought converting a subclass to a super class is not possible.

Pls advice.

Thanks
Mathew Chen
18 years ago
But suppose b() were synchronized too then it could not be called by another thread when the synchronised block in method a() is locked.Am I right?

Thanks
Mathew Chen
Thanks a lot for your reply.

Mathew Chen
Thanks a lot!!

Regards
18 years ago
JSP
Thanks for your response.This would then imply that if a user clicks on the refresh button of the browser,he would be triggering a new request every time.

Thanks
Mathew Chen
18 years ago
JSP
Hi,
I have a question regarding the way requests are dealt with by an application Server.When is a request for a JSP page considered to be a new request?Is it when the compiled servlet is different from the old jsp?

Pls advise.

Thanks
Mathew Chen
[ August 09, 2005: Message edited by: Bear Bibeault ]
18 years ago
JSP
Thanks guys for your responses.
18 years ago
Hi,
Lets say I have a class with two methods method a() and method b().Now a() has a synchronised block of code and it is being called by a thread.Is it now possible for a nother thread to access method b() while method A() is being called?I guess the answer is "Yes" because the enter Object is not locked.Not sure if I am right.

Thanks in advance.

Mathew Chen
Thanks Ulf for your reply.What I wanted to know was if there were certain theoretical concepts to be understood to implement the search technique.For eg I know that binary search is one technique.I was wondering if there is any other technique available.

Thanks again
Mathew Chen
18 years ago
Hi,
I was wondering as to what kind of searching techniques(eg binary search etc) can be used with Java?

Thanks
Mathew Chen
18 years ago
Thanks for your reply Bear.Do you mean the scriplets and the other code which you write in a JSP page?If you are talking about them then I agree that they are part of the doService() in the background.But is it possible to specifically write code in the doService() of the JSP.I guess not because the servlet results only after the jsp page is compiled.

Thanks
Mathew
18 years ago
JSP
Hi,
Are there situations where we need to write code in the doService() or any of the other methods in JSPs?I for one haven't had the need to.Just curious to know if there is ever a need?

Thanks
Mathew
18 years ago
JSP
Thanks Valentine for your detailed response.I really appreciate it.

Regards
Mathew
Thanks Merril for your reply.I think I missed out the LookUpDispatch class too.

Thanks again
18 years ago