Newbie to java complete message

hi everyone,
I'm a student currently studying IT and now started java. I have been thrown into the deep end and given some java questions to do over the easter period and seem to be struggling. At the moment there is nobody in university to speak to, so thought you guys would be the best solution and was told to use any resources available.
This is what my lecturer wrote word for word and I don't fully understand what it means? Any help would be greatly appreciated...
"Complete the methods as indicated by the comments. A test application has been provided (LibraryTest.java)-your output should match that indicated in the comments.
A book has the following data associated with it; author, title, classmark, whether it is on loan or not and the date it is due to be returned. The classmark has the form LLDD.DD.LDD.LD where L represents a letter and D a digit.
For example: Author: Bruce Eckel
Title:THinking in Java
Classmark: QA76.73.J38.E2
Due: 28th March 08
It should not be possible to change the author, title and classmark fields of a book object after it has been created. It should not be possible to renew Book objects, they muct return before being loaned out again.
*Book.java is the first command:*
// Book.java
// A class to represent a single book stored in the library.
// Each Book is defined by it's author, title and classmark
/* Create and import appropriate packages */
/* Appropriate class declaration */ {
// Define fields with private access
private String author;
private String title;
private String classmark;
private GregorianCalendar due;
private boolean onLoan;
// Creates a new instance of Book
public Book(String inAuthor, String inTitle, String inClassmark) {
/* Complete method */
// Returns true if the book is currently on loan, false otherwise
public boolean isOnLoan() {
/* Complete method */
// Mark the book as being on loan for a specified period (in days)
public void loan(int numOfDays) {
/* Set the due field to be numOfDays later than today's date. Check for any
possible errors in the use of this method. */
// Mark the book as having been returned
public void returnBook() {
/* Complete method */
/* Appropriate accessors and mutators for author, title, classmark */
// Access the date the book is due to be returned. Should return an
// appropriate value if the book is not currently on loan
public GregorianCalendar getDueDate() {
/* Complete method */
// Produce an appropriate string representation of the book object
public String toString() {
/* Complete method */
// An internal method to check whether the classmark is valid
private static boolean isValidClassmark(String inClassmark) {
/* Complete method */
*This is the second part of the program Library.java*
// Library.java
// A class to represent and manipulate a set of books.
/* Create and import appropriate packages */
/* Appropriate class declaration */ {
// Use a Vector to store the books
private Vector books;
// Creates a new Library instance
public Library() {
/* Complete method */
// Add a book to the library
public void add( String author, String title, String classmark ) {
/* Complete method */
// Produce an appropriate string representation of the book object
public String toString( ) {
/* Complete method */
// Access an element of the list
public Book getBook(int i) {
/* Complete method */
// Determine number of books in the library
public int size() {
/* Complete method */
*This is the LibraryTest.java mentioned in the question:*
/* import necessary packages */
public class LibraryTest {
public static void main(String[] args) {
Library lib = new Library();
lib.add("Bruce Eckel", "Thinking in Java", "QA76.73.J38.E2");
System.out.println(lib);
lib.add("Bruce Eckel", "Thinking in C#", "QA76.73.J28.E2");
System.out.println(lib);
lib.getBook(0).loan(7);
System.out.println(lib);
lib.getBook(0).returnBook();
System.out.println(lib);
lib.add("Cay Horstmann","Big Java","QA76.73.J38.E2");
System.out.println(lib);
          System.out.println(lib.size());
          System.out.println(lib.getBook(1));
/* Should produce output similar to:
Bruce Eckel, Thinking in Java, QA76.73.J38.E2 [available]
Bruce Eckel, Thinking in Java, QA76.73.J38.E2 [available]
Bruce Eckel, Thinking in C#, QA76.73.J28.E2 [available]
Bruce Eckel, Thinking in Java, QA76.73.J38.E2 [20/4/2008]
Bruce Eckel, Thinking in C#, QA76.73.J28.E2 [available]
Bruce Eckel, Thinking in Java, QA76.73.J38.E2 [available]
Bruce Eckel, Thinking in C#, QA76.73.J28.E2 [available]
Bruce Eckel, Thinking in Java, QA76.73.J38.E2 [available]
Bruce Eckel, Thinking in C#, QA76.73.J28.E2 [available]
Cay Horstmann, Big Java, QA76.73.J38.E2 [available]
3
Bruce Eckel, Thinking in C#, QA76.73.J28.E2 [available]
Thanks
Chris
Edited by: chris08 on Mar 31, 2008 10:24 PM

Complete the methods as indicated by the comments.Do you understand this bit? If not, what part is confusing you?
A test application has been provided (LibraryTest.java)-your output should match that indicated in the comments.Do you understand this bit? If not, what part is confusing you?
A book has the following data associated with it; author, title, classmark, whether it is on loan or not and the date it is due to be returned.Do you understand this bit? If not, what part is confusing you?
The classmark has the form LLDD.DD.LDD.LD where L represents a letter and D a digit.Do you understand this bit? If not, what part is confusing you?
You have to do some work too. If you don't, guess what? We're not going to do your homework for you.

Similar Messages

  • BEA-101083 Connection failure.java.io.IOException: A complete message could not be read on socket: 'weblogic.servlet.internal.MuxableSocketHTTP@16907c  at weblogic.socket.SocketMuxer$TimeoutTrigger.trigger

    While trying to publish mesaage by MQ 5.3 .I got the following error
              Please help.
              <Error> <HTTP> <BEA-101083> <Connection failure.
              java.io.IOException: A complete message could not be read on socket: 'weblogic.servlet.internal.MuxableSocketHTTP@1c94ff
              3 - idle timeout: '30000' ms, socket timeout: '30000' ms', in the configured timeout period of '60' secs
              at weblogic.socket.SocketMuxer$TimeoutTrigger.trigger(SocketMuxer.java:775)
              at weblogic.time.common.internal.ScheduledTrigger.run(ScheduledTrigger.java:243)
              at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
              at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
              at weblogic.time.common.internal.ScheduledTrigger.executeLocally(ScheduledTrigger.java:229)
              at weblogic.time.common.internal.ScheduledTrigger.execute(ScheduledTrigger.java:223)
              at weblogic.time.server.ScheduledTrigger.execute(ScheduledTrigger.java:49)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
              

    Can you help me ? I have the same problem.

  • Java.io.IOException: A complete message could not be read on socket

    Hell All , Am gettign this issue very frequently .. From my googling i see that this can be because weblgic server was not able to do an IO operation because of time out or may be because of Net work issue ..
              I would like to know how this can be fixed
              java.io.IOException: A complete message could not be read on socket: 'weblogic.servlet.internal.MuxableSocketHTTP@a7f309 - idle timeout: '30000' ms, socket timeout: '5000' ms', in the configured timeout period of '60' secs

    Hi All,
    Has anyone got any further information on this problem? I have several instances of the message
    ###<Dec 13, 2005 2:29:40 PM GMT> <Error> <socket> <finland> <serviceview> <ExecuteThread: '12' for queue: 'default'> <kernel identity> <> <000424> <I
    OException on socket: weblogic.socket.MuxableSocketDiscriminator@4a4b21 - number of bytes read: '0', buffer: 'null', fd: 23
    java.net.SocketException: Connection refused: Connection refused>
    java.net.SocketException: Connection refused: Connection refused
    at java.net.SocketInputStream.socketRead(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at weblogic.socket.PosixSocketMuxer.readBytesProblem(PosixSocketMuxer.java:898)
    at weblogic.socket.PosixSocketMuxer.deliverGoodNews(PosixSocketMuxer.java:782)
    at weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:708)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
    In my wl-domain.log. I have no idea how to solve this? I am running WebLogic 7 SP4 on HP-UX 11.11 with JDK 1.3.1.09.
    I note that the release notes for WL7 SP 6 release notes mention MuxableSocketDiscriminator. See link http://e-docs.bea.com/wls/docs70/notes/resolved2.html Is this the problem? Anyone else come accross this and solve it?
    Best Regards,
    Kevin.
    Any help much appreciated. Best Regards, Kevin.

  • A complete message could not be read on socket

    hello to everybody...
    I have a client swing application witch call in RMI a stateless ejb deployed on a WeblogicServer 8.1 sp5.
    The problem is that when we have a slow net I receive on the client the following Exception.The server don't receive the calling ( otherwise the complete message time out on the server is of 480 seconds ).So I think that I ahve to set a client timeout,but witch?and how?and where?...perhaps the heartbeat timeout?
    Going around in the internet forums I have seen that a lot of people have the same people...so if someone could be so kind to help us....I would be very grateful...
    thanks for help and sorry for bad english
    weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.io.IOException: A complete message could not be read on socket: 'weblogic.rjvm.t3.T3JVMConnection@b01d43', in the configured timeout period of '60' secs
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at irma.ejb.serviceSessionManager.ServiceSessionManager_b1engw_EOImpl_812_WLStub.getService(Unknown Source)
         at irma.serviceLocator.ResourceLocator.remoteService(ResourceLocator.java:72)

    giorgio giustiniani <> writes:
    You need to increase the value of CompleteMessageTimeout
    andy
    hello to everybody...
    I have a client swing application witch call in RMI a stateless ejb deployed on a WeblogicServer 8.1 sp5.
    The problem is that when we have a slow net I receive on the client the following Exception.The server don't receive the calling ( otherwise the complete message time out on the server is of 480 seconds ).So I think that I ahve to set a client timeout,but witch?and how?and where?...perhaps the heartbeat timeout?
    Going around in the internet forums I have seen that a lot of people have the same people...so if someone could be so kind to help us....I would be very grateful...
    thanks for help and sorry for bad english
    weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.io.IOException: A complete message could not be read on socket: 'weblogic.rjvm.t3.T3JVMConnection@b01d43', in the configured timeout period of '60' secs
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at irma.ejb.serviceSessionManager.ServiceSessionManager_b1engw_EOImpl_812_WLStub.getService(Unknown Source)
         at irma.serviceLocator.ResourceLocator.remoteService(ResourceLocator.java:72)

  • Complete message timeout in weblogic client

    Hi,
    We have a weblogic client application connecting to weblogic server 8.1 SP6. The client is getting the below error while executing a rmi call. I have tried setting the CompleteMessagetimeout in weblogic console as well as the client program (-Dweblogic.CompleteMessageTimeout=480). But still the below exception occurs. Any one can help to identify how to set a higher value for CompleteMessageTimeout in client side ? I noticed a number of threads in the forums, but unable to find a concrete answer.
    ERROR stdErr 22/Jan/2010/09:45:28 - Caused by: java.io.IOException: A complete message could not be read on socket: 'weblogic.rjvm.t3.T3JVMConnection@125d61e', in the configured timeout period of '60' secs
    ERROR stdErr 22/Jan/2010/09:45:28 -      at weblogic.socket.SocketMuxer$TimeoutTrigger.trigger(SocketMuxer.java:796)
    ERROR stdErr 22/Jan/2010/09:45:28 -      at weblogic.time.common.internal.ScheduledTrigger.run(ScheduledTrigger.java:243)
    ERROR stdErr 22/Jan/2010/09:45:28 -      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    ERROR stdErr 22/Jan/2010/09:45:28 -      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    ERROR stdErr 22/Jan/2010/09:45:28 -      at weblogic.time.common.internal.ScheduledTrigger.executeLocally(ScheduledTrigger.java:229)
    ERROR stdErr 22/Jan/2010/09:45:28 -      at weblogic.time.common.internal.ScheduledTrigger.execute(ScheduledTrigger.java:223)
    ERROR stdErr 22/Jan/2010/09:45:28 -      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    ERROR stdErr 22/Jan/2010/09:45:28 -      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

    Hi,
    Please try applying the following two properties in the Service Stub... (This change you need to make on Client Program after getting the "port" reference....rest of the code will be same)
    ((Stub)port)._setProperty("weblogic.wsee.transport.read.timeout ","480");
    ((Stub)port)._setProperty("weblogic.wsee.transport.connection.timeout ","480");
    Actually 60-Seconds is the Default " T3 Connection Timeout " period which u are getting in the Logs...i am finding a way to tune that...amy be some JAVA_OPTIONS..(ideally it is not recommended to change t3 Timeout).
    Are you trying to Upload Large amount of file to the WebService?
    Example:
    HelloWorldService service = new HelloWorldService_Impl();
    HelloWorldPortType port = service.getHelloWorldPortTypeSoapPort();
    int time=Integer.parseInt(args[1]);
    System.out.println("\n\n\t Timeout is set for "+time+"-Seconds");
    ((Stub)port)._setProperty("weblogic.wsee.transport.read.timeout", time);
    ((Stub)port)._setProperty("weblogic.wsee.transport.connection.timeout",30);
    port.sayHello("Jay");
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com/webservices/ (WebLogic Wonders Are Here)

  • Problem with GlassFish and Sun Java System Message Queue

    Hi,
    I used application server PE.8 and I upgraded to Sun Java System Application Server Platform Edition 9.0 Update 1 Patch 1, and I changed all my CLASSPATH and everything. My system is working fine, but the Sun Java System Message Queue that I used before is still showing the queues and physical queues of the previous application server, not the new one. Do you know if there is way to change that and link it to the new version?
    thanks

    Use an ESB like ServiceMix to bridge JMS providers
    http://servicemix.org/
    Or write your own MessageListener to consume from one JMS and publish on another one. Be careful with queues to avoid loosing the ordering - so you probably want to use a single MessageListener per subscription/queue - or to take advantage of Tibco's exclusive queues to ensure ordering is preserved. If ordering doesn't matter then don't worry too much about it and maybe have a pool of consumers to improve throughput
    James
    http://logicblaze.com/

  • My iPhone 6plus will no longer connect to my Dodge UConnect system. Phone calls get a beep "phone call completed" message. Music will play though. Just can't make calls. Tried turning off iCloud and repairing but nothing works. It did work a few days

    My iPhone 6plus will no longer connect to my Dodge UConnect system. Phone calls get a beep "phone call completed" message. Music will play though. Just can't make calls. Tried turning off iCloud and repairing but nothing works. It did work a few days

    Hi Jpcbew,
    The article linked below provides a lot of great information and troubleshooting tips that can help you resolve the issue with your iPhone 6 Plus connecting to you car stereo system. 
    Get help using your iPhone, iPad, or iPod touch with your car stereo - Apple Support
    So long,
    -Jason

  • I have Mac OSX 10.5.8 and get java "error" message when trying to use research tool on Morningstar Java referred me to Apple but they had no update.Any ideas? thanks.e

    I have a imac OSX 10.5.8 and get a java "error" message when trying to use a research tool on Morningstar.Java referred me to Apple but they had no updates. Any ideas? thanks.

    Well I solved my problem.
    What still doesn't make sense though is that dragging iTune audio files directly on to the iTunes application icon gave me the error message... which is why I originally discounted it as being a potential link problem. If I had been able to get files to open normally (i.e. without an error message) I would have known it was a simple link problem. Strange.
    Anyway... relinking my folder of audio files did the trick.
    If you don't already know how here are the steps...
    iTunes > Preferences > Advanced > click on the "Change" button and browse to the folder that contains all of your iTunes audio files... that's it.

  • Can not start Messaging server in Sun Java System Messaging Server 6 2005Q1

    Hi all,
    I installed Sun Java System Messaging Server 6 2005Q1 from Solaris 10 DVD on Solaris 10.
    After the installation, I got directory server, admin server running but messaging server not running. I can not start Messaging server (start smtp, http, pop, imap). I found in directory which I installed messaging server but I could not see script "start-msg" and "stop-msg".
    # pwd
    /opt/SUNWmsgsr/sbin
    # ls
    MoveUser ha_ip_config imquotacheck imsdirmig mkbackupdir
    UpgradeMsg5toMsg6.pl hashdir imsbackup imsexport readership
    configure imexpire imsconnutil imsimport reconstruct
    control-params.txt iminitquota imscripter imsrestore relinker
    deliver immonitor-access imsdaaci mboxutil useconfig
    Any idea what might have gone wrong?
    Thanks.

    Thanks.
    I have a problem when I configure the Messaging Server (by running the /opt/SUNWmsgsr/sbin/configure script):
    Hostname mailtest for this machine is not a fully qualified domain name. Please
    correct this before attempting to configure Messaging Server. Please make sure
    that your DNS is working properly.
    <Press ENTER to continue> {"<" goes back, "!" exits}
    Can you help me fix this problem?
    Thanks.

  • User defined function in java for message mapping

    I wrote the following user defined function in java for message mapping and mapped vendor with this. The aim of this function is to write a error file at defined path when i send empty Vendor value from File to RFC-Function module BAPI_PO_CREATE. The "err.txt" error file is not written when i execute in TEST but the value "ERROR" is returned to destination Vendor Field.
    public String  validation(String a, Container container) {
    //write your code here
    if (a.equals("")) {
    try {
    String source = "Vendor cannot be empty";
    char buffer[] = new char[source.length()];
    source.getChars(0, source.length(), buffer, 0);
    for (int i = 0; i < buffer.length; i +=2)
       f0.write(buffer<i>);
    f0.close();
    FileWriter f1 =  new FileWriter("/10.10.0.55/sapmnt/trans/edixiin/err.txt");
    f1.write(buffer);
    f1.close();
    catch (IOException e) {}
    return "ERROR";

    Hi Senthil,
    Check these things :
    1) Whether you have permission to create a file in that directory.
    2) try giving this 
    10.10.0.55
    sapmnt
    trans
    edixiin
    err.txt
    3) Also check for permissions.
    Hope this will help you.
    Regards
    Suraj

  • Accessing Payload of completed messages in XI

    Hi,
          Is there a way to access the payload of a message (errorred out or succeeded) from XI if the message id is known.
    PS:please leave out RWB and sxi_monitor transactions. i would like to access these payload in XI mapping.
    Thanks and Regards,
    Sundararamaprasad.

    Hi,
    i guess you are not clear with my question. i would like to access the payload of someother completed messages.
    For example consider you run 5 file to file scenarios. now if i want to access the payload of one of these messges after all these messages have been processed, how can i do it in XI mapping.
    Regards,
    Sundararamaprasad

  • Chronic checkpoint not complete message in alertlog file

    Hi,
    We have oracle 10g hosted on linux.i could see the following message in the alert log file.
    Thread 1 cannot allocate new log, sequence 184070 Checkpoint not complete.
    we have 3 redo log groups with 50MB size.
    In the initparameter file:The following values were set.
    log_checkpoint_interval = 0
    log_checkpoint_timeout =1800
    fast_start_mttr_target=0
    Can some one guide me what needs to be done to avoid the chronic checkpoint not complete message in the alertlog file.
    Thanks

    Thank you. Even i listed the history of log switches per hour over the last week:
    DAY 00:00 01:00 02:00 03:00 04:00 05:00 06:00 07:00 08:00 09:00 10:00 11:00 12:00 13:00 14:00 15:0
    18/08 280 279 283 280 281 283 281 275 279 275 230 0 0 0 0 0 0 0
    17/08 279 279 284 281 287 282 282 285 279 279 276 275 278 273 276 277 280
    16/08 277 283 283 277 278 279 277 284 279 278 280 280 279 277 280 281 278
    15/08 281 281 284 279 279 283 283 284 284 285 282 280 281 282 278 287 276
    14/08 272 277 281 278 282 279 279 283 280 281 283 284 283 279 278 278 278
    13/08 279 278 281 281 284 285 281 282 270 277 274 275 281 279 280 279 279
    12/08 396 403 362 431 430 295 280 281 285 285 280 289 289 284 281 284 279
    7 rows selected.

  • Error in local message system; message 008899000001 not complete, Message n

    Hello All,
    While configuring Solman Service Desk, after configuring basis configuration. I am getting following error while creating ticket from satellite system.
    Error in local message system; message 008899000001 not complete
    Message no. BCOS030
    Thanks,
    Piyush

    Hi,
    There were few threads in the past with the same issue, check [this one|ERROR when Trying to Create Support Message in Satillite system;.
    Also [this thread|create support message;.
    Regards
    Naveen

  • How to explain my Java version message?

    How to explain the following Java version message?
    What is 14.2-b01?
    Can I install JDeveloper 10.1.2 using this Java version?
    C:\Oracle\product>*java -version*
    java version "1.6.0_16"
    Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
    Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)Edited by: jetq on Oct 5, 2009 7:40 AM

    jetq wrote:
    How to explain the following Java version message?
    What is 14.2-b01?It's the version of the Client VM. The end user doesn't care about it at least 99% of the time.
    The most important part is this:
    java version "1.6.0_16"
    Can I install JDeveloper 10.1.2 using this Java version?Most likely as 1.6 is the newest version and Update 16 is relatively new (don't know if there is a newer one).
    What are the version requirements for JDeveloper?

  • Java System Messaging Server book?

    Anyone know of a good book to get someone totally up to speed on Sun Java System Messaging server? I haven't found one yet, and all Amazon seems to have is stuff from 2002 and earlier.
    Any suggestions would be very appreciated.
    Thanks -- TGR

    The 5.2 book is very good, and 90% of it applies to 6.x as well.
    http://www.amazon.com/exec/obidos/ASIN/013145496X/packetfilter/002-9686309-6148044

Maybe you are looking for

  • OS language settings break CVI code

    I'm developing software that requires support for chinese language, I've followed the instructions to change this settings for LabVIEW 8.6 (http://digital.ni.com/public.nsf/allkb/91A1863834F4B1A0862575670067D15C) and TestStand 4.1 (http://forums.ni.

  • Mass change in documents

    hello all I need to perform mass changes to some documents. as LSMW does not perform well with the classic enjoy transactions such as CV02N, how can I do that? specifically, I need to 1) change the descriptions in tab "descriptions" 2) set the deleti

  • Podcast subscriptions - where are my episodes?

    i can't figure out where my podcast subscriptions are going. i have subscribed to one free podcast only. in itunes, on the left side, i see where it reads Podcasts and next to the word podcasts, it says 102. when i click on Podcasts, only one podcast

  • Read Timed Out

    Good Day, i have problems with registering my Podcast via Itunes. I have a wordpress blog, using podpress plugin (both newest versions) and i have validated the rss file with the validator. I also imported the podcast over 'eriwetert' > 'podcast abon

  • No Welcome Screen in Aperture 3?

    I am not getting the Welcome Screen when I start Aperture 3, which is titled Welcome to Aperture. How do I get the screen to appear at startup? Is anyone with this screen? I already checked preferences, but could find nothing there. I also tried to c