Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Not sure what I'm supposed to do...

  1. #1
    Member
    Join Date
    Feb 2011
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Not sure what I'm supposed to do...

    So today I got this programming assignment which is due in a week but I don't even understand what is being asked of me. Since my professor sucks at getting back to me via email, I have come to the internet for help.

    Create two implementations of the StringLogInterface interface as provided on [our school's website].
    One of your implementations must use an array for storage and the other must use a linked list for storage. You may not use any of the pre-defined Linked List classes, nor may you use an ArrayList.

    This was given to us on our school website:
    package stringLogs;
     
    public interface StringLogInterface
    {
      void insert(String element);
      // Precondition:   This StringLog is not full.
      // 
      // Places element into this StringLog.
     
      boolean isFull();
      // Returns true if this StringLog is full, otherwise returns false.
     
      int size();
      // Returns the number of Strings in this StringLog.
     
      boolean contains(String element);
      // Returns true if element is in this StringLog,
      // otherwise returns false.
      // Ignores case differences when doing string comparison.
     
      void clear();
      // Makes this StringLog empty.
     
      String getName();
      // Returns the name of this StringLog.
     
      String toString();
      // Returns a nicely formatted string representing this StringLog.
     
      int howMany(String element);
      // Returns an int value indicating how many times element occurs
      // in the StringLog.
     
      boolean uniqueInsert(String element);
      // This method inserts element into the StringLog unless an identical
      // string already exists in the StringLog, in which case, it has 
      // no effect on the StringLog. If it does insert the string, it 
      // retuns true; otherwise it returns false. 
     
      String smallest();
      // This method returns the smallest string in the StringLog. By 
      // "smallest", we mean in terms of the lexicographic ordering
      // supported by the String class's compareTo method. As a 
      // precondition, you should assume that the StringLog is not
      // empty. 
    }
    How do I get started? I'm not asking for anyone to write my code for me, just help me get started please! Thank you.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,270
    Thanks
    176
    Thanked 821 Times in 764 Posts
    Blog Entries
    5

    Default Re: Not sure what I'm supposed to do...

    What exactly are you having problems with? Start at the requirements - you need to implement an interface. See the following links:
    Interfaces (The Java™ Tutorials > Learning the Java Language > Interfaces and Inheritance)
    What Is an Interface? (The Java™ Tutorials > Learning the Java Language > Object-Oriented Programming Concepts)

Similar Threads

  1. I don't understand what I'm supposed to do
    By dmcettrick in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 11th, 2011, 09:34 AM
  2. I dont see why this program is not doing what it is supposed to
    By Leprechaun_hunter in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 12th, 2011, 08:24 AM
  3. Replies: 1
    Last Post: March 15th, 2010, 10:03 PM