Reference extending class name

I have a base class that instantiates a Logger object via: Logger.getLogger(this.getClass().getName());
When a class extends the base class the Logger still maintains the name of the base class. How do I initiate the Logger, in the base class, with the name of the extending class? Or is that not possible without the extending class passing its name to some sort of instantiation function?
Thanks,
jpbarto

When a class extends the base class the Logger still maintains the name of the base class.I'm surprised to hear that, as this.getClass() will return the object's class, not the reference type's. Instead of this.getClass(), you can call Logger.getLogger(TheClassYouWantToUse.class.getName());

Similar Messages

  • Error while extending controller: class name is wrong or not included

    Hi All,
    I am getting this error while I port my extended controller class to the custom top and assign this controller to the page. I have made sure its the class file that is copied. The directory is correct, the permissions were given using chmod 775. There exists a soft link betwen the custom top and the oracle top as well. What else am I missing here?
    Error: oracle.apps.fnd.framework.OAException: Could not create Java class: (oracle.apps.ap.oie.entry.webui.XXEntryFlowPageCO) associated with region: (GeneralInformationPG). This is probably because the class name is wrong or not included in project.

    :( Started out with that Gyan. If i do give the path with xx. appended to it, it lets me save and when i log back in and there are no changes to the page. I go to the personalise option to find the modification has been overwritten. I was told that this is so because Oracle doesnt recognise the xx.path and since there exists a soft link already the standard path with the new controller name should work.
    i have really tried both of these options and am not sure what could be wrong. thanks for all your attempts to help. anything else i can try?

  • How to get the class name  static method which exists in the parent class

    Hi,
    How to know the name of the class or reference to instance of the class with in the main/static method
    in the below example
    class AbstA
    public static void main(String[] args)
    System.out.println(getXXClass().getName());
    public class A extends AbstA
    public class B extends AbstA
    on compile all the class and run of
    java A
    should print A as the name
    java B
    should print B as the name
    Are there any suggestions to know the class name in the static method, which is in the parent class.
    Regards,
    Raja Nagendra Kumar

    Well, there's a hack you can use, but if you think you need it,Could you let me the hack solution for this..
    you probably have a design flaw and/or a misunderstanding about how to use Java.)May be, but my needs seems to be very genuine..of not repeat the main method contents in every inherited class..
    The need we have is this
    I have the test cases inheriting from common base class.
    When the main method of the test class is run, it is supposed to find all other test cases, which belong to same package and subpackages and create a entire suite and run the entire suite.
    In the above need of the logic we wrote in the main method could handle any class provided it knows what is the child class from which this main is called.
    I applicate your inputs on a better way to design without replicating the code..
    In my view getClass() should have been static as the instance it returns is one for all its instances of that class.
    I know there are complications the way compiler handles static vars and methods.. May be there is a need for OO principals to advance..
    Regards,
    Raja Nagendra Kumar
    Edited by: rajanag on Jul 26, 2009 6:03 PM

  • 'My Application Page' is not allowed here because it does not extend class 'System.Web.UI.Page'

    I have a custom SharePoint 2010 solution that includes an aspx page. The aspx page in is in the /layouts folder within the solution and I created it by just adding an application page to the solution. I am trying to create a parent-child relationship between
    two different lists in SharePoint. From the parent I have a custom button on the ribbon that creates a child item with the ID of the parent stamped on it.
    The page is just a processing page that forwards on parameters from the parent to the new child item. (i.e. the ID value)
    The code generated when I add the aspx page is below:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="MY.Solution.Layouts.MY.Solution.processingpage" MasterPageFile="~/_layouts/application.master" %>
    <asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    </asp:Content>
    <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    </asp:Content>
    <asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server"> Processing Page </asp:Content>
    <asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" > Processing Page </asp:Content>
    The code behind is as follows:
    using System;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Administration;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.Utilities;
    using System.Reflection;
    namespace MY.Solution.Layouts.MY.Solution
    public partial class processingpage : LayoutsPageBase
    protected void Page_Load(object sender, EventArgs e)
    try
    //Get a reference to the SPWeb object
    SPWeb oWeb = SPContext.Current.Web;
    //Use the Parameters That Are Passed In
    SPList thisList = oWeb.Lists[new Guid(Request.QueryString["List"])];
    SPListItem thisItem = thisList.GetItemById(int.Parse(Request.QueryString["ID"]));
    sContentType = thisItem["ContentType"].ToString();
    sContentTypeID = thisItem.ContentTypeId.ToString();
    if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAIID = thisItem["ID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/Blist" + "/NewForm.aspx?AIID=" + sAIAuditID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAIID = thisItem["AIID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/AList" + "/NewForm.aspx?AIID=" + sAIID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAICID = thisItem["AICID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/CList" + "/NewForm.aspx?AICID=" + sAICID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else
    LoggingService.LogError("MY.Solution - Processing Page", "No Applicable Content Type Found.");
    catch (Exception ex)
    LoggingService.LogError("My.Solution - Processing Page", ex.Message);
    finally
    //DO SOME FINAL THINGS HERE WHEN REQUIRED.
    In the page I need to use Request.QueryString to get the values from the URL. But when I deploy the solution and load the page I get the error:
    'MY.Solution.Layouts.MY.Solution.processingpage' is not allowed here because it does not extend class 'System.Web.UI.Page'.
    When I change the line:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="MY.Solution.Layouts.MY.Solution.processingpage" MasterPageFile="~/_layouts/application.master" %>
    to inherit as follows:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" MasterPageFile="~/_layouts/application.master" %>
    it does not work either.
    If I change it to inherit like below:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="System.Web.UI.Page" MasterPageFile="~/_layouts/application.master" %>
    it also does not work.
    What does this error actually mean?  And why doesn't the default code generated by Visual Studio work?

    @NadeemYousuf I have tried this too and it didn't work.  
    What does the error even mean?  And why does the error appear with default Visual Studio code?  In my example I have just added a basic application page with no other code in it and it still does not work.

  • When extending class do constructors get implemented as well

    Say i need to call a list as an object and it was an extension of another list. Would the constructor be the same but with the extended list name??
    For example:
    First class:
    public class ListR
            //variables
         public ListModelR()
              trackCount = 0;
              firstTrack = null;
              lastTrack = null;
         }///rest of code...
    Would the class that extended this hav a constructor of its class name or would i have to reference ListModelR?
    Thanks James

    You cant have a constructor that is different from your classes name.
    class A
         public A()
              int a = 5;
    class B
         public B()
              super(); //executes the super class's default constructor
    }

  • Class name of  stub for EJBHome Impl

    Hi,
    I am doing a context.lookup to find the EJBHome stub and I print the class name
    of the object that is looked up, every time a diffrent name comes up.
    Object obj = ic.lookup("ejb/test");
    System.out.println(hh.getClass().getName());
    I get $Proxy1
    and when I add the two more lines
    Object obj1 = ic.lookup("javax/jms/QueueConnectionFactory");
    System.out.println(obj1.getClass().getName());
    Object obj = ic.lookup("ejb/test");
    System.out.println(obj.getClass().getName());
    and re-run only my client I get:
    weblogic.jms.client.JMSConnectionFactory
    $Proxy2
    I understand that weblogic generates the stub dynamically, but how come (class name
    of) a object bound to JNDI tree keeps changing?
    and why does that happen for the connection factory(is that not a RMI stub too)?
    viswa

    viswa <[email protected]> wrote:
    Hi,
    I am doing a context.lookup to find the EJBHome stub and I print the class name
    of the object that is looked up, every time a diffrent name comes up.
    Object obj = ic.lookup("ejb/test");
    System.out.println(hh.getClass().getName());
    I get $Proxy1
    and when I add the two more lines
    Object obj1 = ic.lookup("javax/jms/QueueConnectionFactory");
    System.out.println(obj1.getClass().getName());
    Object obj = ic.lookup("ejb/test");
    System.out.println(obj.getClass().getName());
    and re-run only my client I get:
    weblogic.jms.client.JMSConnectionFactory
    $Proxy2
    I understand that weblogic generates the stub dynamically, but how come (class name
    of) a object bound to JNDI tree keeps changing?You can look at java/lang/reflect/Proxy.java to see how proxy class names are generated.
    BTW, it looks like WebLogic 7.0 doesn't use JDK dynamic proxies anymore and generates
    stub/skeleton bytecode by itself, so Stub class names are no longer $Proxy123 but xxx_WLStub.
    and why does that happen for the connection factory(is that not a RMI stub too)?My guess is that the actual stub reference is buried somewhere else.
    viswa--
    Dimitri

  • How to access a method of a class which just known class name as String

    Hi,
    Now I have several class and I want to access the method of these class. But what I have is a String which contain the complete name of the class.
    For example, I have two class name class1and class2, there are method getValue in each class. Now I have a String containing one class name of these two class. I want to access the method and get the return value.
    How could I do?
    With Class.forName().newInstance I can get a Object. but it doesn't help to access and execute the method I want .
    Could anybody help me?
    Thanks

    Or, if Class1 and Class2 have a common parent class or interface (and they should if you're handling them the same way in the same codepath)...Class c = Class.forName("ClassName");
    Object o = c.newInstance(); // assumes there's a public no-arg constructor
    ParentClassOrInterface pcoi = (ParentClassOrInterface)o;
    Something result = pcoi.someMethod(); Or, if you're on 5.0, I think generics let you do it this way: Class<ParentClassOrInterface> c = Class.forName("ClassName");
    // or maybe
    Class<C extends ParentClassOrInterface> c = Class.forName("ClassName");
    ParentClassOrInterface pcoi = c.newInstance();
    Something result = pcoi.someMethod();

  • How to get Class Name given along with java.exe

    Hi friends,
    I am Mukesh, currently facing one problem
    On command prompt to execute any java program we give :
    C : \.-- > java ClassName
    This ClassName I need in my application, I want to do some post processing on that.
    Actually see what I want :
    public class Base
    static Base object;
    public static void main(String[] args) throws Exception
    object=(Base)Class.forName("Derived Class Name").newInstance();
    void main()
    public class Derived extends Base
    void main()
    System.out.println("Hello World");
    I am trying to Run Derived Class, since there is no entry point found, default JVM invoke the Base class's entry point, there I want to load
    Derived Class, but I am not getting any identity of derived class in Base class.
    I found one temporary solution to this problem :
    C: \ -- >java Derived Derived
    & in Base class, I have loaded class
    object=Class.forName(args[0]).newInstance();
    But I dont want to write the same thing twise just to know the Class name which is given along with java.exe.
    Is there any way to get the ClassName supplied with java.exe
    I have tried a lot, still I am trying !!!
    If any one knows the answer, help me.
    Regards.
    Mukesh.

    Multiple post. Please continue in other thread
    http://forum.java.sun.com/thread.jspa?threadID=5196980&tstart=0

  • If i know class name ,can i find out application set name in CRM for PCUI

    Hello,
    i found the class name in debugging..it is cl_crm_bsp_frame_sres
    now i want to make it as z class to make the changes to the methods.
    for that i need to know the application set name or zname...
    so that i can modify the configure settings by going through tcode SPRO..
    so please let me know the ways to find the same..
    thanks for your time.
    sheela.

    Hi Jagan.
    I would like to suggest a few references,
    [SAP HELP - Standard Reference for URL parameters and Application parameters in Webdynpro|http://help.sap.com/saphelp_nw04s/helpdata/en/7b/fb57412df8091de10000000a155106/frameset.htm]
    [SAP HELP - Standard Reference for URL of a WebDynpro Application|http://help.sap.com/saphelp_nw04s/helpdata/en/8c/780741375cf16fe10000000a1550b0/frameset.htm]
    [SAP HELP - Standard Reference for Using paramters for Calling a Web Dynpro Application|http://help.sap.com/saphelp_nw04s/helpdata/en/2f/e7574174c58547e10000000a1550b0/frameset.htm]
    [SDN - Reference for Call another WD Application (Web Dynpro for ABAP)|Call another WD Application (Web Dynpro for ABAP);
    Hope that's usefull.
    Good Luck & Regards.
    Harsh Dave

  • How to get the current class name in static method?

    Hi,
    I'd like to get the current class name in a static method. This class is intended to be extended. So I would expect that the subclass need not to override this method and at the runtime, the method can get the subclass name.
    getClass() doesn't work, because it is not a static method.
    I would suggest Java to make getClass() static. It makes sense.
    But in the mean time, does anybody give an idea to work around it?
    Thank you,
    Bill

    Why not create an instance in a static method and use getClass() of the instance?
    public class Test {
       public static Class getClassName() {
          return new Test().getClass();

  • How to reference the class-instance, created in parent class.

    Hi, I have following scenario. During compilation I am gettting error message -- "cannot resolve symbol - symbol : Variable myZ"
    CODE :
    under package A.1;
         ClassZ
         Servlet1
              ClassZ myZ = new ClassZ;
    under package A.2;
         Servlet2 extends Servlet1
              myZ.printHi();
    How to reference the class-instance created in the parent class?

    some corrections ...
    under package A.1;
         ClassZ
         Servlet1
              init()
                   ClassZ myZ = new ClassZ;
    under package A.2;
         Servlet2 extends Servlet1
              myZ.printHi();

  • Can't find "Delegate Class Name" for JDBC Helper Service

    Hi,
    I downloaded WLServer 6.1 with sp1 and WLPortal 4.0, installed them on Solaris 7 using default DB cloudscape -- everything was fine. Now, I'm trying to configure database to Oracle 8.1.7.
    In "Configure the JDBC Helper Service" section of document "Configuring WebLogic Portal for Oracle Databases" (http://e-docs.bea.com/wlp/docs40/deploygd/oraclnew.htm), step 2 requires to enter value of "com.bea.p13n.util.jdbc.internal.OracleJDriverJdbcHelperDelegate" to "Delegate Class Name". But, I can't find this "Delegate Class Name" variable. The available varialbles on the Configuration tab on my screen are: Maximum Number of Retries, Maximum Wait Time (milliseconds), Use CLOBs for Read?, Use CLOBs for Write?. And the Configuration tab is the only available tag for JDBC Helper Service. Did I download a different version from other people? I downloaded it within 3 months.
    Can anyone help?
    Thanks in advance,
    Jane

    Thanks Steve.
    I had my own jndi.properties file that's why it was working with ejb bean I created in the AM and not with the sdo web service.
    I didn't know I had to add the jndi properties to the connection.xml maybe you can update the documentation.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <ns2:References xmlns:ns2="http://xmlns.oracle.com/adf/jndi">
    <Reference className="oracle.jbo.client.svc.Service"
    name="{/test/model/common/}DepartmentModuleService">
    <Factory className="oracle.jbo.client.svc.ServiceFactory"/>
    <RefAddresses>
    <StringRefAddr addrType="serviceInterfaceName">
    <Contents>test.model.common.serviceinterface.DepartmentModuleService</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="serviceEndpointProvider">
    <Contents>ADFBC</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="jndiName">
    <Contents>test.model.common.DepartmentModuleServiceBean</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="serviceSchemaName">
    <Contents>DepartmentModuleService.xsd</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="serviceSchemaLocation">
    <Contents>test/model/common/serviceinterface/</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="jndiFactoryInitial">
    <Contents>oracle.j2ee.rmi.RMIInitialContextFactory</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="jndiProviderURL">
    <Contents>ormi://localhost:23791/SvcInterfaceDeploy_MiddleTier</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="jndiSecurityPrincipal">
    <Contents>fmwadmin</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="jndiSecurityCredentials">
    <Contents>welcome</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="serviceSchemaName">
    <Contents>HRAppService.xsd</Contents>
    </StringRefAddr>
    </RefAddresses>
    </Reference>
    </ns2:References>
    thanks edwin

  • What does $ sign in a class name signifies

    I have downloaded a project as a jar file(zip), when I unzipped it it gave me two files
    SchoolQadBase.java( Which has Class defn and methods)
    SchoolQadBase$RecordType.java(this has a Record type defined it).
    What does the $ sign in the class name signifies?
    Can I just include the RecordType in my SchoolQadBase.java and delete the other file?
    If I rebuilt the project does that affect any of my functionality.
    SchoolQadBase$RecordType.java
    public enum RecordType
      CUSTOMER, END_USER, SHIP_TO, SALES_ORDER;
      private String value;
      public String getValue()
        return this.value;
    My Java class SchoolQadBase.java
    package org.atcc.erpproxy.model;
    import java.io.Serializable;
    import java.util.Date;
    public class ErpQADBase extends AbstractErpObject
      implements Serializable
       private String rollNumber = "";
       private String department1 = "";
      private String department2 = "";
      private String room = "";
       private RecordType recordType;
    public RecordType getRecordType() {
        return this.recordType;
      public void setRecordType(RecordType recordType) {
        this.recordType = recordType;
    }

    What does the $ sign in the class name signifies?It signifies that it is an inner class
    Can I just include the RecordType in my SchoolQadBase.java and delete the other file?Definitely not
    Edited by: tjacobs01 on Nov 17, 2008 7:46 PM

  • Appending a _ in front of the jsp class name when using weblogic.jspc

     

    http://e-docs.bea.com/wls/docs60/jsp/reference.html
              java weblogic.jspc -d /weblogic/classes -keepgenerated primero.jsp
              "rb" <[email protected]> wrote in message
              news:[email protected]...
              >
              > hi,
              >
              > i do
              >
              > java weblogic.jspc -d /weblogic/classes primero.jsp
              >
              > and it only is generated a _primero.class and do not appear
              > the .java ?
              >
              > what i do bad ?
              >
              > thanks for advance
              >
              >
              > Rodrigo Fonseca da Fonseca <[email protected]> wrote:
              > >Hi,
              > >
              > >I'm using weblogic.jspc to compile some jsp fiels. The compilation is
              > >complete and successfully, but the names of generated files .java and
              > >..class are strange.
              >
              >
              >
              > >
              > >For example, compiling a file named change_login_data.jsp, the resulting
              > >files are change95_login_95_data.java and
              > >change95_login_95_data.class. Compiling a file named buy.jsp, the
              > >resulting files are buy.java and buy.class (fine situation). Why???
              > >
              > >I'm using:
              > >
              > >java weblogic.jspc -d c:\jsp_result -classpath
              > >
              >
              >c:\weblogic\myserver\serverclasses;c:\weblogic\lib\weblogicaux.jar;c:\weblo
              gic\classes
              > >-compiler jikes.exe -J-verbose -keepgenerated -verbose
              > >change_login_data.jsp
              > >
              > >
              > >thanks
              > >Rodrigo
              > >
              > >
              > >
              > >Mark Spotswood wrote:
              > >>
              > >> The namespace for java class files is more restrictive
              > >> than for JSP files. We prepend these underscores so
              > >> that if, for example, someone names their JSP "1.jsp",
              > >> we get a class file with a legal name. We did consider
              > >> not doing this for files which started with characters
              > >> we kenw to be valid (in fact we may have put it in a
              > >> service pack), but later found that this was not sufficient
              > >> because its possible to name a jsp file something that
              > >> clashes with java keywords ("class.jsp" for example).
              > >> Rather than making the scheme even more complex,
              > >> we decided to go back to the original sheme of always
              > >> prepending the underscore.
              > >> --
              > >> mark
              > >>
              > >> Mika Moilanen wrote:
              > >>
              > >> > >>>>> "Shankar" == Shankar Roy <[email protected]> writes:
              > >> >
              > >> > Shankar> Problem seems to go away with weblogic510sp4.jar in
              compilation
              > >classpath.
              > >> > Shankar> Shankar.
              > >> >
              > >> > Shankar> Shankar Roy wrote:
              > >> >
              > >> > >> Hi,
              > >> > >> Can anyone tell why when I invoke weblogic.jspc the class file
              that
              > >is
              > >> > >> generated has a _ in front of the class name
              > >> > >>
              > >> > >> java -classpath
              > >> > >>
              >
              >/space/shankar/weblogic/lib/weblogicaux.jar:/space/shankar/weblogic/classes
              /boot:/space/shankar/weblogic/classes:/space/shankar/dev/dev/lib/activation.
              jar:/space/shankar/dev/dev/lib/classes12.zip:/space/shankar/dev/dev/lib/mail
              .jar:/space/shankar/dev/dev/lib/oroinc.jar:/usr/java/lib/classes.zip
              > >> > >> weblogic.jspc -package com.careassured.jsp -commentary login.jsp
              > >> > >>
              > >> > >> produces a class file by the name _login.class
              > >> > >>
              > >> > >> Thanks for any help pointers.
              > >> > >> Shankar.
              > >> >
              > >> > Not with WLS5.1 and weblogic510sp6.jar, we still get '_' prefixed
              > >> > classes...
              > >> >
              > >> > Actually we're suffering quite a lot because of this bug in
              > >> > weblogic.jspc. Are there any plans for fix?
              > >> >
              > >> > --
              > >> > Best Regards,
              > >> > Mika
              > >> > ----------------------------------------------------------
              > >> > [email protected] phone: +358-0-511-23587
              > >> > Nokia Networks, PO box 320, FIN-00045 NOKIA GROUP, Finland
              > >> > ----------------------------------------------------------
              >
              

  • Why public class name should be same as the java file name

    Hi,
    I would like to know, why public class name should be same as the its java file name. Iam in the process of finding the answer to this question. Can someone help me out in finding the explanation.
    Thanks in advance,
    Manoj

    This is a requirement of the Java reference compiler released by Sun. I have used compilers that did not require this, but most seem to follow the reference compiler (which is a very good idea). I am NOT sure if this is specified in the Java Language Specification. Some of the other regulars who are more familiar with the JLS than I may be able to tell you.
    ? {?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for