Generic Class Errors continue

Hi have had "generic class" errors with my printers on my MacPro for over two years now. First with a Samsung and now with a Brother printer. I have the latest drivers for the Mac, I have the latest Leopard and I still get these really annoying errors that require restarting everything. I had the problems with Tiger too.
Is there any way to avoid this kind of mess?
Any help appreciated.

kittireddy wrote:
What is "Generic class" in Java? and what's use of that?It's just added to confuse new programmers.
Give me an idea with an exampleNo problem:
public class GenericsExample {
    public static void main(String[] args) {
        new X<String>(new X<String>("Y"));
class X<Y> {
    Y x;
    X(Y y) { x = y; }
    X(X<Y> y) { System.out.println("y.x = "+y.x); }
}

Similar Messages

  • Best way to call a function in a generic class from a base class

    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        newTCreated(T t)
    }

    Sorry, I pressed Tab and Enter last time when typing the code so I posted without meaning to
    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        public void newTCreated(T t)
            // add the t to some internal list
        public T getT(int index)
            // get the object from the internal list
    public class BaseClass
        public BaseClass(List<?> list)
            list.newTCreated(this);
    public class SubClass extends BaseClass
        public SubClass(List<SubCass> list)
            super(list);
    }This doesn't compile because of the call to newTCreated in the BaseClass constructor because BaseClass is not necessarily of type T. Is there any way of checking when I call the newTCreated function that the BaseClass is actually of type SubClass? I could either add the call explicitly in each SubClass's constructor or have a function addToList in BaseClass that is called from the BaseClass constructor but overloaded in each subclass but both of those rely on future subclasses doing the same. Or I could change the newTCreated function to take an argument of type BaseClass and then cast it to type T but this doesn't give a compilation error, only a runtime exception.
    It seems like there should be solution but having only recently started writing Generic classes I can't find it. Thanks in advance for any help,
    Tom

  • Could not load mediaLib accelerator wrapper classes. Continuing in pure Jav

    Can anyone provide an explanation/solution to the following error message:
    "Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode."

    This problem seems to occur if only the JAI JAR files are installed without the native DLL's. Is there some property that can be passed in to JAI so that it doesn't look for the DLL's? The lookup is causing quite a delay in initial server response time. We don't want to include the DLL's since they are a big pain for our customers to install and the performance issue is not a concern.
    Thanks for any help!
    -Matt

  • Class error message

    I get an error message when I boot up Livetype:
    An unexpected error occured. (*class error for 'ProSystemStore;' class not loaded)
    When I hit continue on the error message Livetype opens but when I select "New" under File the app quits. Any ideas other than reloading the app?
    thanks,
    Rob
    G5 Mac   Mac OS X (10.4.5)  

    sorry, I can't duplicate your duplicative post. the error appears ot be a unix command or a Java thingy but I cannot find any such item on my system. I can finds tons of "class" files and several with "pros" in the filoename but none with "prosystem"
    Hope you get better advice.
    bogiesan

  • Generic classes and the catch block

    Is there a reason why the catch block doesn't work with generic classes?

    JLS 8.1.2:
    <quote>
    It is a compile-time error if a generic class is a direct or indirect subclass of Throwable.
    </quote>
    <quote>
    This restriction is needed since the catch mechanism of the Java virtual machine works only with non-generic classes.
    </quote>
    I guess they didn't feel a need to tinker with the JVM definition to achieve that.
    Too slow!
    Message was edited by:
    DrLaszloJamf

  • Need help with generic class with comparable type

    Hi. I'm at University, and I have some coursework to do on writing a generic class which offers ordered binary trees of items which implement the comparable interface.
    I cant get the code to compile which I have written.
    I get the error: OBTComparable.java uses unchecked or unsafe operations
    this is the more detailed information of the error when I compile with -Xlint:unchecked
    OBTComparable.java:62: warning: [unchecked] unchecked call to insert(OBTType) as
    a member of the raw type OBTComparable
    left.insert(insertValue);
    ^
    OBTComparable.java:64: warning: [unchecked] unchecked call to insert(OBTType) as
    a member of the raw type OBTComparable
    right.insert(insertValue);
    ^
    OBTComparable.java:75: warning: [unchecked] unchecked call to find(OBTType) as a
    member of the raw type OBTComparable
    return left.find(findValue);
    ^
    OBTComparable.java:77: warning: [unchecked] unchecked call to find(OBTType) as a
    member of the raw type OBTComparable
    return right.find(findValue);
    ^
    and here is my code for the class
    public class OBTComparable<OBTType extends Comparable<OBTType>>
      // A tree is either empty or not
      private boolean empty;
      // If the tree is not empty then it has
      // a value, a left and a right.
      // These are not used it empty == true
      private OBTType value;
      private OBTComparable left;
      private OBTComparable right;
      // Create an empty tree.
      public OBTComparable()
        setEmpty();
      } // OBTComparable
      // Make this tree into an empty tree.
      private void setEmpty()
        empty = true;
        value = null; // arbitrary
        left = null;
        right = null;
      } // setEmpty
      // See if this is an empty (Sub)tree.
      public boolean isEmpty()
      { return empty; }
      // Get the value which is here.
      public OBTType getValue()
      { return value; }
      // Get the left sub-tree.
      public OBTComparable getLeft()
      { return left; }
      // Get the right sub-tree.
      public OBTComparable getRight()
      { return right; }
      // Store a value at this position in the tree.
      private void setValue(OBTType requiredValue)
        if (empty)
          empty = false;
          left = new OBTComparable<OBTType>(); // Makes a new empty tree.
          right = new OBTComparable<OBTType>(); // Makes a new empty tree.
        } // if
        value = requiredValue;
      } // setValue
      // Insert a value, allowing multiple instances.
      public void insert(OBTType insertValue)
        if (empty)
          setValue(insertValue);
        else if (insertValue.compareTo(value) < 0)
          left.insert(insertValue);
        else
          right.insert(insertValue);
      } // insert
      // Find a value
      public boolean find(OBTType findValue)
        if (empty)
          return false;
        else if (findValue.equals(value))
          return true;
        else if (findValue.compareTo(value) < 0)
          return left.find(findValue);
        else
          return right.find(findValue);
      } // find
    } // OBTComparableI am unsure how to check the types of OBTType I am comparing, I know this is the error. It is the insert method and the find method that are causing it not to compile, as they require comparing one value to another. How to I put the check in the program to see if these two are of the same type so they can be compared?
    If anyone can help me with my problem that would be great!
    Sorry for the long post, I just wanted to put in all the information I know to make it easier for people to answer.
    Thanks in advance
    David

    I have good news and undecided news.
    First the good news. Your code has compiled. Those are warnings not errors. A warning is the compiler's way of saying "I understand what you are asking but maybe you didn't fully think through the consequences and I just thought I would let you know that...[something] "
    In this case it's warning you that you aren't using generics. But like I said this isn't stopping it from compiling.
    The undecided news is the complier is warning you about not using generics. Are you supposed to use generics for this assignment. My gut says no and if that's true then you have no problem. If you are supposed to use generics well then you have some more work.

  • Help on compiling my generics class

    Hi,
    I'm still trying to grasp generics, and I'm having trouble getting the following code to compile. Can someone tell me what is wrong?
    public class Test<T extends Test>
      T t;
      public static void test(Test<? extends Test> test)
        System.out.println(test.t.t);
    }Thanks a lot
    -Cuppo

    It doesn't make sense to me that you would create a generic whose generic type must extend the generic class. Though this compiles with warnings, no errors. If you can't compile, be sure your using JDK 5.0 and you're not defining the -source option.
    Also I don't think you can have:
    public static void test(Test<? extends Test> test)I think you need:
    public static void test(Test<? super Test> test)This works:
    public class Test<T extends Test>
      T t;
      public static void test(Test<? super Test> test)
        System.out.println(test.t.t);
      public static void main(String[] args)
           MyTest t = new MyTest();
           test(t);
    class MyTest extends Test
         public MyTest()
              super();
              t = this;
    }

  • Multiple inherited with generics classes

    Hello all, here is my generic observer/ subject code.
    package jstock;
    * @author yccheok
    public interface Observer<S, A> {
        public void update(S subject, A arg);
    public class Subject<S, A> {
        public void attach(Observer<S, A> observer) {
            observers.add(observer);
        void notify(S subject, A arg) {
            for (Observer<S, A> obs : observers) {
                obs.update(subject, arg);
        private List<Observer<S, A>> observers = new CopyOnWriteArrayList<Observer<S, A>>();
    }However, when I try to implements more than one class (single class only is ok), I get the following error :
    /home/yccheok/Projects/jstock/src/org/yccheok/jstock/gui/MainFrame.java:40: org.yccheok.jstock.engine.Observer cannot be inherited with different arguments: <org.yccheok.jstock.engine.RealTimeStockMonitor,java.util.List<org.yccheok.jstock.engine.Stock>> and <org.yccheok.jstock.engine.StockHistoryMonitor,org.yccheok.jstock.engine.StockHistoryServer>
    public class MainFrame extends javax.swing.JFrame implements
    Here is the code which I am implementing the generic classes.
    public class MainFrame extends javax.swing.JFrame implements
    org.yccheok.jstock.engine.Observer<RealTimeStockMonitor, java.util.List<org.yccheok.jstock.engine.Stock>>,
    org.yccheok.jstock.engine.Observer<StockHistoryMonitor, StockHistoryServer>
    May I know how I can avoid the error message?
    Thank you.
    cheok

    However, when I try to implements more than one classMore than one interface, you mean.
    May I know how I can avoid the error message?You can't implement a generic interface more than once.
    http://angelikalanger.com/GenericsFAQ/FAQSections/ProgrammingIdioms.html#Can%20a%20class%20implement%20different%20instantiations%20of%20the%20same%20parameterized%20interface?

  • Making a generic class that uses interfaces.

    I've learned how to do this:
    class MyClass<T extends Object> {
    }But I want a generic class that takes objects that implement another object like this:
    class MyClass<T implements Runnable> {
    }Why doesn't this work? Is there any way to do this?

    happypigface wrote:
    Yes thank you. Thats strange that Java does that. I didn't really test it yet, but I know Runnable is an instance and eclipse doesn't have any compiling errors for it. I'm glad that you can do this. It wouldn't very useful if you could only specify that the generic class had to be a subclass, not an implementation of a class.Generics are about types rather than classes and interfaces. Hence, one specifies the supertype(s) of a Generic Parameter by using the extends keyword.
    Note, however, it's possible to extend multiple interface types but only one class type.

  • Using static .values() method of Enum in Generic Class

    Hi *,
    I tried to do the following:
    public class AClass<E extends Enum<E> >  {
         public AClass() {
              E[] values = E.values(); // this DOESN'T work
              for (E e : values) { /* do something */ }
    }This is not possible. But how can I access all Enum constants if I use
    an Enum type parameter in a Generic class?
    Thanks for your help ;-) Stephan

    Here's a possible workaround. The generic class isn't adding much in this case; I originally wrote it as a static method that you simply passed the class to:
    public class Test21
      public static enum TestEnum { A, B, C };
      public static class AClass<E extends Enum<E>>
        private Class<E> clazz;
        public AClass(Class<E> _clazz)
        {  clazz = _clazz;  }
        public Class<E> getClazz()
        {  return clazz;  }
        public void printConstants()
          for (E e : clazz.getEnumConstants())
            System.out.println(e.toString());
      public static void main(String[] argv)
        AClass<TestEnum> a = new AClass<TestEnum>(TestEnum.class);
        a.printConstants();
    }

  • Plug-in load class error while running portalapp.xml file in NWDS7.0

    hi,
    im facing a problem in NWDS7.0 while running portalapp.xml file im getting error realted some plug-in load class error.
    Even 3 times i have re-installed but still getting same error.
    Please help me how to over come this. This is error im getting :
    Please open this link with Firefox so that you can able to see error.
    http://www.imageurlhost.com/images/jri5lj7lpftu23ejyye0_Error.jpg
    Regards,
    prasad.

    Dear Prasad
    Please right click on portalapp.xml > open with > check all the available editors.
    Also restore default edition in NWDS. Go to windows > preference > Workbench OR Web editors > click on restore default and Apply and then Ok.
    then close the NWDS and open it.
    Hope it will helps
    Best Regards
    Arun Jaiswal

  • Hp LaserJet 1200 Generic Class: Waiting for device

    I have 2 computers that I want to print to my hp Laserjet 1200 printer. We are using an iogear 4-port usb 2.0 sharing switch. One computer prints fine but the other always displays a message "Generic Class: Waiting for device." Help!

    Both computers have the printer driver installed. The usb device does not have a driver to install. You just plug in the usb cords to each computer and the printer. You only install a driver if using a pc operating system.

  • Getting the name of the generic class?

    I have a generic class declared as such:
    public class MyClass<T>
    and I want to access the name of the <T> class a member function in that class? I just can't figure out which syntax to use.
    Thank you!
    Joshua

    Sorry, I'm a little bit confused at your answer.
    I cannot seem to instantiate an object of class T, like: T item = new T();does not work. If I can't create an object of type T, then I can't get it's type. I need to get the class even if I don't have any instantiated objects (or if I can create a blank one), so that I can use the name to fetch the objects from the persistence engine. Here is the class, so you can see what I'm talking about. I have in there now what seems like it should be right, but doesn't compile.
    A small example of solution please?
    public class PersistentSelectorCellEditor<T> extends AbstractCellEditor
              implements TableCellEditor {
         JComboBox control;
         List<T> choices;
         Session session;
         public PersistentSelectorCellEditor() {
              initializeComponents();
         public PersistentSelectorCellEditor(Object value) {
              initializeComponents();
              this.control.setSelectedItem(value);
         private void initializePersistence() {
              session = LabApp.getSession();
              session.beginTransaction();
         private void initializeComponents() {
              initializePersistence();
              populateList();     //query for selections to fill combo box
              control = new JComboBox((ComboBoxModel)choices);
         private void populateList() {
              //query to populate drop down lists
              Query query = session.createQuery("from " + T.class.getName());
              choices = query.list();
         public void setValue(T value) {
              control.setSelectedItem(value);
         public T getValue() {
              return (T)control.getSelectedItem();
         //interface members
         public Object getCellEditorValue() {
              return control.getSelectedItem();
         public Component getTableCellEditorComponent(JTable table, Object value,
                   boolean isSelected, int row, int column) {
              return control;
    }Thank you!
    Joshua

  • Array of generic class

    Hi.
    i have to create an array of generic class
    ex: GenericClass<E> [ ] x = new GenericClass<E>[ y ]
    is it possible?
    i can create GenericClass<E> [ ] x; but i can't initiate it in this way..
    Someone know how i can do it?

    crosspost
    http://forum.java.sun.com/thread.jspa?threadID=746524&messageID=4272614#4272614

  • Script Error, Continue?"

    When I launch Media Center Deluxe II I have this error:
    Script Error, Continue?
    I download the patch but the error persist. I have a windows 2000 with a FX5200 Thx a lot.

    There is one solution, you can always upgrade to XP.
    I know the prospect of upgrading to XP is not a pleasant one, I am in the same boat.  But I don't see that I have much choice.
    All I can say is, this is the LAST time I buy ANY MSI card board or other.  
    I ran into a similar problems with ASUS years ago and haven't bought an Asus product since.  I had bought the latest Asus motherboard and the latest Asus Deluxe video card and found out they were incompatible with eachother.  I never bought Asus since.
    Apparently the problem with my MSI Motherboard and MSI Video Card is similar.   Except this time MSI says it works with Win 2000 Pro.  I buy it and find the same script error as you.  My supplier won't give me a refund an I can't afford to waste money on another Video Card.  I contacted Tech support and they told me that they never heard of such a problem.   They further told me it should work and they have no idea how to fix it.   They suggested I try reinstalling my OS.
    As far as I am concerned, the problem is with thier installer.   It appears to be looking for some video or multimedia function that is only available in XP.
    If MSI wants to regain my trust, they better provide me with a simple interface to get this remote working or provide me with a FREE replacement product that supports all the features of my card.  Otherwise they will lose my business for good.   I don't like companies who lie to sell products.  
    I am a supplier of MSI and other products and sell about 500 MSI products a month in each of my locations.  It would be a real shame if I dumped MSI components altogether.
     :O

Maybe you are looking for

  • 9.2.0.3 patch set installation fails on Solaris 8

    i've installed Oracle9iR2 (64-bit) client on a Solaris 8 system and i'm now having problems installing the 9.2.0.3 patch set. during the installation process i get the following error message from OUI: Error in invoking target install of makefile $OR

  • Clicking on 'ADF Calendar Component activity' should navigate to New page

    Jdeveloper Version - 11.1.2.0.0 We implemented the ADF calendar component and it displays fine. However, we have a requirement that by clicking on the activity, it should navigate to another new page. For an activity, there are options like contextMe

  • Using LR with the iPad app?

    I want to upgrade to CC mainly for the ability to browse my photos from my iPad. 1. Does the iPad app download/cache photos onto the iPad? 2. Is there someway to remotely (away from your network) use the iPad app to browse your LR catalog on your com

  • Extract app from mac mini

    how can i install iphoto (ilife 08) from a new mac mini to my G5 imac ?

  • How to export itunes playlist to sd card

    I have an Audi A4 with a SD card reader, I have tried to export my play lists into it with no succes. can anybody help me?