Can we define two public classes in a same file?

Is it possible to define two public classes in a same file
Thanks a lot
So jag

Do you realize RMI too, what caused this please!
loading chat.rmi.RMIServer.class for debugging...
chat.rmi.RMIServer.class successfully loaded
java.rmi.StubNotFoundException: Stub class not found: chat.rmi.RMIServer$RemoteLogonManager_Stub; nested exception is:
java.lang.ClassNotFoundException: chat.rmi.RMIServer$RemoteLogonManager_Stub
java.lang.ClassNotFoundException: chat.rmi.RMIServer$RemoteLogonManager_Stub
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at sun.rmi.server.RemoteProxy.loadClassFromClass(RemoteProxy.java:198)
at sun.rmi.server.RemoteProxy.getStub(RemoteProxy.java:100)
at sun.rmi.server.RemoteProxy.getStub(RemoteProxy.java:62)
at sun.rmi.server.UnicastServerRef.setSkeleton(UnicastServerRef.java:155)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:115)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:102)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:276)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:180)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:80)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:67)
at chat.rmi.RMIServer$RemoteLogonManager.<init>(RMIServer.java:23)
at chat.rmi.RMIServer.<init>(RMIServer.java:16)
at chat.rmi.RMIServer.main(RMIServer.java:11)
at symantec.tools.debug.Agent.runMain(Native Method)
at symantec.tools.debug.MainThread.run(Unknown Source)
The communications channel closed.

Similar Messages

  • If you have two public class in a java file what will be the error ?

    Q:If you have two public class in a java file what will be the error and how will you remove that.?

    Kannan_S wrote:
    I dont want you to be on that list . Here goes my explanation..
    A class is well defined with members and functions
    An abstract class is not defined well as compared to a full fledged class (talking more generically)
    An interface is more abstract.
    I was asking the author who has posted this question to be like a class(very clear)
    and not either as an abstract class or an interface
    Hope i have made it clear..Not in the slightest. This has absolutely no bearing whatsoever on the question asked. Not to mention that classes are classes, and all equal in the eyes of the compiler, be they abstract, concrete or interfaces. It's difficult to see what your point is, to be honest, but I suspect it wouldn't be worth seeing anyway

  • Why we can have only one public class in one source file

    why we can have only one public class in one source file

    When the java compiler is run it looks for classes referenced by the classes you are directly compiling. When looking for these referenced classes it looks for source as well as class files and compiles them automatically if the coresponding class files are missing, or older than the source.
    In order to do this it must be able to work out the source file name for any given class which might be referenced from another (the rule also applies to package level access).

  • Two public classes in one source file

    Can anyone please explain what is the exact reason why the java source file name should be same as the only allowed public class name in the source file. Answer only if you know the correct answer. No gusses please. I read the other postings on this topic. None of the answers were correct.

    One reason is that some RISC processor architectures
    (like those Sun uses mostly) have hierarchical memory
    architectures. This hierarchy is divided into global
    modules and local (global-accessible) submodules. The
    advantage of this is that the processor needs lesser
    memory access "points" (handles), as the modules
    delegate CPU calls to the submodules.
    The java compiler can utilize this and increase
    performance by loading the entire source files into
    the memory and assign them a CPU handle (the module
    ID). It'll be later used for linking, e.g. The public
    class in a file will be loaded as a module and gets
    the handle, all other non-public classes in that file
    will be submodules.
    If there is no public class, a generic module will be
    used, so that's no problem. But if there are multiple
    public classes, you'd end up with several modules and
    just one handle to assign, thus having ambiguity. The
    CPU won't be able to address the correct module.
    This all only applies to RISC CPUs, but for obviuos
    cross-platform compatibility reasons it was added to
    the standard - it doesn't hurt the other
    architectures, but helps those with hierarchical
    memory management.Thanks, but the rooster explanation makes more sense to me.
    Now could someone please express it a la Majinda?

  • Can you use two tax classes in the same payroll run?

    Hi,
    I have a wage type that is currently set to Tax Class 1 (fully taxed) for processing class 71,  I need to change it to tax class 7 (Withholding and SUI only) and have it computed as part of the regular payroll run and also by itself using offcycle.
    When I have it set as Tax Class 1, all is well, when I change it to tax class 7, I get the error...
    BSI Messages and Status 4101 CAN NOT PROCESS DUPLICATE RESIDENT STATE FED
    This is the first time we're using this tax class and I think i have it set up correctly in the tax model but am not for sure.
    Any suggestions?   I'd really appreciate some guidance as I've looked
    Thanks!
    Stephanie Abrahamson

    I think you should not change the PRCL 71 from 1 to 7 wide open. Start it with begin date of pay period you want and keep the history with PRCL 71 1.
    As well check the config of tax model.
    Arti

  • Why it is necessary that public class name should  same as filename in java

    hi,
    why it is necessary that public class name should same as filename in java.
    As I know that it is a convention, but I want the information why this convention is made.
    thanx.

    user13445117 wrote:
    but suppose if i am creating a java file with default access modifire then we do not need to save the file name as a class name.So, your question is "Why does the rule about top-level classes being in a file of the same name apply +only+ to public classes"?
    If it were applied to all classes, then we could never have two top-level classes in the same file. Doing that is generally not a good idea, but it might be useful from time to time. EJP already told you why it applies to public classes, and, since these are the most common by far, it's a fair compromise that it apply to them but not to other classes.
    Was this the reason the original designers did it that way 15 or so years ago? Don't know, don't care, but it's one plausible explanation. Maybe it was just a balance between simplicity and clarity on the one hand, and flexibility on the other.
    It's certainly not something I can see caring that much about, unless you're doing an in-depth history on Java, or writing an in-depth treatise on computer language and compiler theory.

  • Can you have two itunes accounts on the same computer?

    Can you have two itunes accounts on the same computer and if so how do you access them without syncing each others music?

    Yes. Use separate iTunes libraries(launch iTunes with the Shift(Windows) or Option(Mac OS X) key held down as needed), or different user accounts on the computer.
    (100648)

  • Can i use two icloud accounts on the same computer?

    can i use two icloud accounts on the same computer?

    You can have content from two iTunes Store accounts in one library, and multiple libraries on a computer.
    (98306)

  • Can you synch two itunes accounts on the same computer?

    can you synch two itunes accounts on the same computer?

    pflip wrote:
    can you synch two itunes accounts on the same computer?
    What do you mean by, "synch two itunes accounts"? You don't sync iTunes accounts.
    WHat are yoru trying to accomplish?
    iTunes account= Used to make iTunes purchases.
    iTunes library = All your media and what you see when you open iTunes.

  • Can I open two Safari windows at the same time?

    Can I open two Safari windows at the same time and split the windows in two on my screen? Right now, I have to open Safari and Firefox to get the split screen. I know I can press command to get multiple tabs, but that's not what I want. I want to use Safari on two open windows.

    HI,
    Open a browser window in Safari. Then Command + N
    Press command and ~ or ` to toggle between the windows.
    Carolyn

  • Can we create two dashboard prompts for the same column in the samepage

    hi ,
    can we create two dashboard prompts for the same column on the same page,
    I have a date column and I am trying to create 2 dashboard prompts on the same page one as from date and the other one as to date.Is this possible to create.When I am trying to create it is giving me error like cannot use same column for creating the prompt
    Any suggestions or ideas

    863997 wrote:
    hi ,
    can we create two dashboard prompts for the same column on the same page,
    I have a date column and I am trying to create 2 dashboard prompts on the same page one as from date and the other one as to date.Is this possible to create.When I am trying to create it is giving me error like cannot use same column for creating the prompt
    Any suggestions or ideasYou are correct. You cannot build two prompts on the same column. Use this link for instructions on how to build a "between prompt" because of this fact:
    http://oraclebizint.wordpress.com/2008/02/26/oracle-bi-ee-101332-between-prompts-for-date-columns-using-presentation-variables/

  • HT5012 Can I install two root certificates with the same name in iPad?

    Can I install two root certificates with the same name in iPad?

    Antaeus00 wrote:
    I tried sending a request for help,
    But did you succeeed in sending a request for help?
    Did you receive a response? How long has it been since you sent a request?
    but I need someone with more authority to talk to.
    There is no one with more authority than iTunes store support. We herem are only users.

  • Why only one public class in a source file?

    why we have to write only one public class in a source file?

    PhHein wrote:
    Because the JLS says so.It does?
    From section 7.6 of the JLS (third edition):
    When packages are stored in a file system (§7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:* The type is referred to by code in other compilation units of the package in which the type is declared.
    * The type is declared public (and therefore is potentially accessible from code in other packages).
    This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
    >
    To my mind, it's strongly recommending, rather than mandating, this practice. All academic of course, merely shifting the answer from "Because the JLS says so" to "Because pretty much all Java compilers say so". I don't know of any that don't enforce this, but of course, that doesn't mean they don't exist

  • Can we access two different Siebel BO in Same OPA Rule Base

    Hi all,
    can we access two different BO's from same rule base.
    what i means is,can we pass siebel data to OPA Rule Base from two different BO's .
    Thank you for your help in advance.

    There are two approaches to do this and they both involve making some small changes on the Siebel side.
    You can create an Integration Object which contains all the business components that you want to send to OPA if you are using an Integration Object mapping.
    If you would prefer to use a Business Object mapping then you will have to create a new Business Object which combines the BCs of all the Business Objects that you want to send to OPA.
    As you can see, although one approach involves Integration Objects and one involves Business Objects they both work by creating a single object which is an amalgamation of the information that you want to send to OPA.
    Cheers
    Frank

  • Can i Know the predefined class Which DoesThe same function As  of Describe

    Hi Abapers,
                            Can i Know the predefined class Which DoesThe same function As  of   Describe  Key Word.
    With Regards
    Bhaskar Rao

    I cannot find a method or property in ACEDAO to retrieve the precision and scale of a field. Maybe you could try get the number of a decimal type and use some mathematical methods to get the precision.
    I find there are some way to get the precision by ADO or OLEDB.
    For ADO way, you could check this thread:
    https://social.msdn.microsoft.com/Forums/office/en-US/883087ba-2c25-4571-bd3c-706061466a11/how-can-i-programmatically-access-scale-property-of-a-decimal-data-type-field?forum=accessdev
    For OLE DB , you could use IColumnsInfo::GetColumnInfo to get DBCOLUMNINFO::bPrecision.
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms722704(v=vs.85).aspx
    Also people in C++ may not familiar with access development, the
    Access for Developers forum is good place for access develop issue. You could try there.
    Hope this helps some.
    Shu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Upload .mov from iphone to mac

    I've had trouble getting .mov files playing on my iMac after syncing from my iPhone 4.  They don't play under VLC, Quicktime, etc. But now I've found that emailing the movie to my account on the iMac works because I can play the .mov attachment. So i

  • Acrobat Pro crash

    After using 3d pdf file, Acrobat X Pro crashed and don't start anymore. Shutdown, restart I have tried already. No result. In win task manager there are only arcotray, and if I try to start program then acrobat.exe*32 appears only for 1 second inside

  • Inconsistent behavior when selecting single or multiple messages

    Mail seems very sensitive when selecting messages, either single or multiple. It often opens a message I have single clicked on (I do not use the pane) so that I could delete, and when selecting multiple messages for deletion or filing it often opens

  • VLANs with L3 Switch (SG-500)

    Hi, I'd like to know how to configure VLANs in SG-500 with it's L3 functionality (switch router). The switch is up and running currently in L2 mode and has a few hosts connected to it. Some questions I have: If I switch it to L3 (set system mode rout

  • CAN Channel to Frame API

    Hi All, In a bit of a jam...we're using CAN channel api to manage a few functions of a piece of hardware thats on a CAN bus.  Works great. Code is attached as a picture. We are duplicating the system and have loaded the entire PC up and had to resort