Please I Need Help to solve these Java Questions. THANKS IN ADVANCE


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 12 of 12

Thread: Please I Need Help to solve these Java Questions. THANKS IN ADVANCE

  1. #1
    Join Date
    Jan 2006
    Posts
    5

    Please I Need Help to solve these Java Questions. THANKS IN ADVANCE

    Q: Which is true about the client's view of exceptions received from an EJB?
    1 Receiving an application exception communicates to the client that the bean will no longer be accessible
    2 The client of a CMT bean can determine if the transaction has been rolled back by calling the getStatus() method of the java.transaction.UserTransaction interface
    3 If the client receives an EJBException, the client must discontinue the transaction
    4 If the client receives the java.rmi.RemoteException exception, the client will not typically know whether the method has completed

    2> is my answer with the limited experience I had with EJB. If not could you please explain?

    Q: In Java, how can I place three Components along the bottom of a Container?
    1 Set the Container's LayoutManager to be a BorderLayout and add each Component to the "South" of the Container
    2 Set the Container's LayoutManager to be a FlowLayout and add each Component to the Container
    3 Set the Container's LayoutManager to be a BorderLayout; add each Component to a different Container that uses a FlowLayout, and then add that Container to the "South" of the first Container
    4 Use a GridLayout for the Container and add each Component to the Container
    5 Do not use a LayoutManager at all and add each Component to the Container

    I have no idea so please need help??

    Q: In Java, what can I do to be certain that garbage collection will run when you want:
    1 You cannot be certain when garbage collection will run
    2 Use the Runtime.gc() method to force garbage collection
    3 Ensure that all the variables you require to be garbage collected are set to null
    4 Use the System.gc() method to force garbage collection
    5 None of the above

    4> is my answer if this not correct again could you please explain??

    Q: To connect Java to another language I would use
    RMI
    JNI
    DCOM
    Serialization

    RMI is my answer. If not please explain.

    Many Thanks and I need help with these questions.
    Morgan

  2. #2
    Join Date
    Jan 2006
    Posts
    53
    I'll give you this one: You cannot force garbage collection.

    I'm new here, so I don't want to sound rude (right off the bat), but that's all I want to say because this feels like I'm doing someone's homework. It would benefit you more to study the topics and understand them thoroughly than to simply hear the pinpoint answers to specific questions.

  3. #3
    Join Date
    Jan 2006
    Posts
    5

    Is there anyone here who can enlighten me with these questions?

    Thanks for your help. However I am a computer programmer and I was trying to solve some questions on line. Its not home work and I wonder why you said that.

    Youíre not rude however I think itís not nice either to making this kind of assumption. I will not post these questions here if these are my home work. I would do whatever I could and then submit.

  4. #4
    Join Date
    Aug 2005
    Location
    Melbourne...Australia
    Posts
    279
    Quote Originally Posted by MorganS
    Thanks for your help. However I am a computer programmer and I was trying to solve some questions on line. Its not home work and I wonder why you said that.

    Youíre not rude however I think itís not nice either to making this kind of assumption. I will not post these questions here if these are my home work. I would do whatever I could and then submit.
    LMAO..

    You are not a computer programmer if you are asking these questions!!

  5. #5
    Join Date
    Jan 2006
    Posts
    53
    Well I'm looking at this: Some Java Exam Web Site

    I'm just saying, it's far better for you to do in-depth study by reading books and going through tutorials, and then self-testing afterward to see how you're doing.

    I assumed you were posting homework questions due to the elementary nature of the particular questions you're having trouble with and the cut-and-paste format they're presented in.

    I'm just trying to help. Reading through the first couple chapters of Java In A Nutshell and Java Foundation Classes In A Nutshell, or any of a hundred beginner's Java books will benefit you tremendously.

  6. #6
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    62
    Hi,

    Q: To connect Java to another language I would use
    RMI
    JNI
    DCOM
    Serialization
    RMI is used for Java-to-Java only communication
    JNI is used to interface with c/c++/assembly
    DCOM can be connected to from Java (i cant remember where i have seen a product that does this..)

    CORBA issimilar to RMI but is not restricted to Java only; most OO languages have binding for CORBA

    Correct me if I am wrong.

    Kind regards,
    Noel

  7. #7
    Join Date
    Jan 2006
    Posts
    5

    Noel Thanks a lot

    Perhaps you can put me in the enlighteen me with this question

    Q: Which is true about the client's view of exceptions received from an EJB?
    1 Receiving an application exception communicates to the client that the bean will no longer be accessible
    2 The client of a CMT bean can determine if the transaction has been rolled back by calling the getStatus() method of the java.transaction.UserTransaction interface
    3 If the client receives an EJBException, the client must discontinue the transaction
    4 If the client receives the java.rmi.RemoteException exception, the client will not typically know whether the method has completed

    2> is my answer with the limited experience I had with EJB. If not could you please explain?


    Thanks so much

  8. #8
    Join Date
    Jan 2006
    Posts
    5

    Lamo

    Quote Originally Posted by Code_Nerd
    LMAO..

    You are not a computer programmer if you are asking these questions!!
    Wow thats a heavy comment you put here. I am not here to judge you however I guess you're not helping either. I do code in C and trying to learn Java and checking all online exam and these questions I found on line.

    Perhaps you may like to listen Bob Marley "Judge None ..." song.

    Peace

  9. #9
    Join Date
    Jan 2006
    Posts
    5

    Laszlo

    Quote Originally Posted by Laszlo
    Well I'm looking at this: Some Java Exam Web Site

    I'm just saying, it's far better for you to do in-depth study by reading books and going through tutorials, and then self-testing afterward to see how you're doing.

    I assumed you were posting homework questions due to the elementary nature of the particular questions you're having trouble with and the cut-and-paste format they're presented in.

    I'm just trying to help. Reading through the first couple chapters of Java In A Nutshell and Java Foundation Classes In A Nutshell, or any of a hundred beginner's Java books will benefit you tremendously.

    Thanks a lot for yours HELP. You're correct I was looking on line java exam and got those questions.

    However I have so little time and I am sure you would not mind to answer some of my questions if I am stuck. After all knowledge is for sharing right?

    Thanks again.

  10. #10
    Join Date
    Aug 2005
    Location
    Melbourne...Australia
    Posts
    279
    Quote Originally Posted by MorganS
    Wow thats a heavy comment you put here. I am not here to judge you however I guess you're not helping either. I do code in C and trying to learn Java and checking all online exam and these questions I found on line.

    Perhaps you may like to listen Bob Marley "Judge None ..." song.

    Peace
    I am not judging you, just stating you are NOT a computer programmer!!

    You want answers a simple google search will find them all for you!!

    Peace..

  11. #11
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    Quote Originally Posted by Laszlo
    I'll give you this one: You cannot force garbage collection.

    I'm new here, so I don't want to sound rude (right off the bat), but that's all I want to say because this feels like I'm doing someone's homework. It would benefit you more to study the topics and understand them thoroughly than to simply hear the pinpoint answers to specific questions.
    You can, through invokation of System.gc() or Syste,getRuntime().gc().

  12. #12
    Join Date
    Dec 2005
    Location
    New Jersey
    Posts
    290
    Quote Originally Posted by graviton
    You can, through invokation of System.gc() or Syste,getRuntime().gc().
    No, you can't. System.gc() will simply suggest to the JVM that this might be a good time to run garbage collection. It will not force it.

Similar Threads

  1. Java Swing GUI Resize Questions
    By lokelo in forum Java
    Replies: 2
    Last Post: 01-20-2006, 02:15 AM
  2. Replies: 1
    Last Post: 05-08-2002, 07:17 AM
  3. Replies: 9
    Last Post: 03-21-2002, 06:38 AM
  4. Replies: 0
    Last Post: 01-31-2002, 11:08 PM
  5. java 2 Sample questions
    By yardy hardy in forum Java
    Replies: 1
    Last Post: 01-14-2002, 11:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center