Click to See Complete Forum and Search --> : Beginner Java Question


nili
06-05-2006, 06:30 PM
Hi,

I am a beginner to java so this might fall into a beginner question. This is a bit of code that i am trying to understand.

This is the code that triggers the method below.
MessageBox.post(parent, rq1.getString("sameAsOldId"), rq1.getString("error.TIT

This is the method that gets triggered from the call above.
public static MessageBox post(Window w, String msg, String title, int type) {
return post(w, msg, (Object) null, title, type);
}


Can anyone explain the second method to me. What does public static MessageBox post mean? and why do you have return post again inside - what happens at this point and what gets returned. Is there a method "post" that i have to look for elsewhere in the code that gets triggered from the return post?

Thanks in advance to everyone.


-Nilima

chazzy
06-05-2006, 08:36 PM
public - is available to all classes, vs private or protected which allow varying levels of internal control.

static - meaning that it doesn't vary much in calls

MessageBox is the type of object that is returned

post is the method's name.

yes, there is another method named "post" that takes different parameters than yours, specifically a null object.