What is wrong by inheriting from Object?

Hi and thank you for reading my question,
I have tried the following program:
import java.util.*;
interface I {}
class A1 {}
class B1 extends A1  implements I {
    B1() {}
class B2 extends A1 implements I {
    B2() {}
class Cell<V> 
V  value;
<T extends V> Cell(T a) {value = a;}
V get() { return value; }
class Foo {
    void  test(boolean b){
     Cell<? extends B1> cb1 = new Cell<B1>(new B1());
     Cell<? extends B2> cb2 = new Cell<B2>(new B2());
     Cell<? extends I> c1 = ( b ? cb1 : cb2);
     Cell<? extends A1> c2 = ( b ? cb1 : cb2);
}and I have got the following error:
Test.java:31: incompatible types
found   : Cell<capture of ? extends java.lang.Object&I&A1>
required: Cell<? extends A1>
     Cell<? extends A1> c2 = ( b ? cb1 : cb2);
                                 ^
1 errorWhy c2 is incorrect and c1 is correct?
It seems that there is a bug by inheriting from Object.
I have tried the same code but now class A extends
a class different than Object:
import java.util.*;
interface I {}
class A1 extends Vector<Integer>{}
class B1 extends A1  implements I {
    B1() {}
class B2 extends A1 implements I {
    B2() {}
class Cell<V> 
V  value;
<T extends V> Cell(T a) {value = a;}
V get() { return value; }
class Foo {
    void  test(boolean b){
     Cell<? extends B1> cb1 = new Cell<B1>(new B1());
     Cell<? extends B2> cb2 = new Cell<B2>(new B2());
     Cell<? extends I> c1 = ( b ? cb1 : cb2);
     Cell<? extends A1> c2 = ( b ? cb1 : cb2);
}This program compiles without any error. Both c1 and c2 are correct.

A bug, I've submitted bug 6278798.

Similar Messages

  • What's wrong with notifications from Apple Community?

    There's the repeating issue I've had recently, that is, with all settings set up to receive notifications I don't receive them like with this thread: https://discussions.apple.com/thread/6278682? Is it a system problem? If no then I might look in my mail preferences, but could you, please, tell me the Apple Comm. message adress I receive alerts from, in order to be sure it's not been set to be filtered?
    Thank you.

    The alerts are automatic if you have settings set to receive them. Ther are occasional delays - due to system loading, I think.
    Barry

  • What is wrong - my miniatyres from the last year do not show?

    When I start Elements Organizer 8  the latest images do not show - just grey pictures with an hourglass.When I enlarge the miniatyres so that only 2 of the show at a time they suddenly appear. This is very troublesome because I can not organize my pictures. Pleas help!

    Hi,
    Select all your files >> Right click >> Select 'Update thumbnail'. This should show all your thumbnails perfectly and the hour glass symbol should go away.
    On re-launch if you again face the same issue, try repair and optimize for your catalog.
    Launch Organizer and click File >> Catalog. Select your catalog and hit 'Repair' button. Tick the check box for re-building indices.
    Next perform optimize by hitting the 'Optimize' button on the catalog manager dialog.
    See if that helps?
    Thanks
    andaleeb

  • OMB Plus - Import a table from DB to Repository- What is wrong ??

    OMBCREATE TRANSIENT IMPORT_ACTION_PLAN 'EMP'
    OMBALTER IMPORT_ACTION_PLAN 'EMP' ADD ACTION 'TABLES' SET REF SOURCE TABLE 'EMP' SET REF TARGET ORACLE_MODULE '/BI/SOURCE_TAB/'
    OMBIMPORT FROM METADATA_LOCATION FOR IMPORT_ACTION_PLAN 'EMP'
    ERROR: PUB03302: Failed connecting to user SCOTT in source database null:null:null: j
    ava.lang.Exception: Internal Error: SQL Exception. Please contact Oracle Support
    with the stack trace and details on how to reproduce it..
    What is wrong with my code ??
    Thanks.

    Oracle object name created with "s are case sensitive and have to be referenced with "s. Oracle object names are stored upper case and can be referenced mixed case without "s.
    Check if there is a option for the Access plugin to migrate case-insensitively.

  • Installed the update tonight and now my phone (Lumia 928) won't power up.  I've tried a soft reset, but the screen goes from the Nokia logo to a red Verizon screen to a black screen.  What's wrong and how do I fix it?  Help!

    Installed the update tonight and now my phone (Lumia 928) won't power up.  I've tried a soft reset, but the screen goes from the Nokia logo to a red Verizon screen to a black screen.  Tried it 10 times with the same result.  What's wrong and how do I fix it?  Help!

        Oh no Mr.Ected!
    I can see if we can get your phone back on! I understand how important it is to have a phone. Have you tried this to see if we can get it back on? http://vz.to/1DZhteH . If it is still goes to a red Verizon screen and then to black we might need to do a master reset. While the phone is off try this:http://vz.to/1DZhXkU Be mindful this is the last resort because it will erase everything on the phone. If you have done back up assistant in the past you will be able to get you contacts back. Please let me know if you need any more help.
    AmberF_VZW
    Follow us on Twitter @VZWSupport

  • TS3276 An email sent from my iMac has a button linked to a clip hosted on Vimeo. When received, the link functions on iMac and iPad, but opens a window of app icons on iPhone and iPod touch. Any ideas what's wrong?

    An email sent from my iMac has a button linked to a clip hosted on Vimeo. When received, the link functions on iMac and iPad, but opens a window of app icons on iPhone and iPod touch. Any ideas what's wrong?

    For anyone else reading this thread, it is worth knowing that sometimes an email is, or can be, corrupted thereby jamming the works. The solution above is good, but I just wanted to suggest another one.
    If the problem arises, go to an online mail access service, such as Mail2Web.com and login to you mail account there and delete the offending message.
    Problem solved.
    And George, as this is all entirely voluntary, whinging about no takers may not endear people to you. Besides which, a few minutes of searching on Google would have found you a number of solutions.

  • Running Windows XP service pack 3. Updated Firefox from 8.0 to 9.0. Now when Firefox opens "The URL is not valid and cannot be loaded" is displayed in a window and no home page appears. What's wrong?

    Running Windows XP service pack 3. Updated Firefox from 8.0 to 9.0. Now when Firefox opens "The URL is not valid and cannot be loaded" is displayed in a window and no home page appears. What's wrong?

    That issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • HT3228 When I try to send an email from my Iphone it will not send and tells me the recepient will not allow relaying.  The email will sit in my outbox and then at some point will send.  It sometimes takes days.  What is wrong with my settings?

    When I try to send an email either new, or reply on my phone I receive a notification that recepient will not allow relaying.  The email will then sit in my outbox.  At some point it will send but it is hardly dependable.  What is wrong with my settings?

    The collum to the right listed similar problems.  The solution appears to be that under smtp outgoing settings the user name and password are listed as optional.  I have not plugged in the information and it seems to be working.  However from my office it always allowed the relaying.  The true test will be when I try to respond later from the road.
    Thank you for your help.

  • When we purchase from iTunes the balance is not coming off of the gift cards. We have family sharing on but when my kids purchase songs they are credited to our credit card and not the gift card that is already in their account. What's wrong?

    When we purchase from iTunes the balance is not coming off of the gift cards. We have family sharing on but when my kids purchase songs they are credited to our credit card and not the gift card that is already in their account. What's wrong?

    Hi Angela1313,
    I see that you have a question about using gift cards with Family Sharing. Here is an article with some information that my be pertinent to this issue:
    iTunes Gift balances
    http://support.apple.com/kb/ht5035
    Learn more
    Learn how to send an iTunes Gift or redeem iTunes Gift Cards and content codes. If you're using Family Sharing, the credit you redeem will only be available to you. iTunes Store credit on your account isn't shared with other family members.
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • I have a brand new iPad newest version. Wifi. The messaging won't send out but I receive messages from others. What is wrong?

    I have the newest version of the iPad (3rd generation) with wifi. The messaging won't send out but I'm receiving messages from others when I'm using it. They also come through on my iphone at the same time. But I can't send them out on the iPad. I tried someone's suggestion of changing the DNS to 8.8.8.8 and that did not work to fix it. What is wrong with this thing?  Thank you in advance for your help.

    Are you trying to send a message to a cell number or an email address?  iPad does MMS, not SMS, meaning it can't send a message to a number.  It can send a message to an email address........

  • Question about app itune, it automatically charge money from my card on Apr/24th, but i have not buy any music or any apps on that day!! what's wrong

    question about app itune, it automatically charge money from my card on Apr/24th, but i have not buy any music or any apps on that day!! what's wrong ??

    Please look at your E-Bill and click report a problem.

  • HT1498 I just bought Apple TV 2 weeks ago. I have a brand new Samsung LED TV. Everything works fine.  I rented a movie from iTunes and it took 4 hours to download. My friend said this is wrong, his movies play instantly, so what's wrong?

    I just bought Apple TV 2 weeks ago. I have a brand new Samsung LED TV. Everything works fine.  I rented a movie from iTunes and it took 4 hours to download. My friend said this is wrong, his movies play instantly, so what's wrong?

    I just bought Apple TV 2 weeks ago. I have a brand new Samsung LED TV. Everything works fine.  I rented a movie from iTunes and it took 4 hours to download. My friend said this is wrong, his movies play instantly, so what's wrong?

  • TS3276 Mail rejected password to one of my 3 accounts with Gmail, all old.  Successfully entered the account from Google mail interface.  What's wrong?

    I have had Mail for years.  Have new MacBook Pro, set my old 3 accounts with Gmail, used them successfully. Yesterday, Mail rejected password to one of my accounts and does not accept it repeatedly.  I entered this account from Gmail page, no problem, so my password is correct.  Went back to Mail, this particular account is rejected.  Checked all Mail preferences, all are the same as initially set.  What is wrong?

    In both cases, the default address is right.  However, upon receiving the email, it says the wrong address.  Thus, when people reply to my emails, I do not get it in my apple email, I have to sign in under the other (wrong) email address.

  • What's wrong with my code for comparing date retreived from db and sysdate?

    Hi all,
    I need to retrive date from the DB and compare it to system date.i have posted the code below.i get java.sql.SQL Exception:Io exception:Socket closed.
    What's wrong with the code?please help me.Thanks in advance.
    public boolean date() throws IOException, SQLException {
    Connection con1;
    long millis = System.currentTimeMillis();
    Timestamp timestamp = new java.sql.Timestamp(millis);
    ResultSet rs4 = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection(
    "jdbc:oracle:thin:@abc:1605:xyz",
    "cdf", "cdf");
    Statement stmt_exp = con.createStatement();
    rs4 = stmt_exp.executeQuery("SELECT DATE FROM TABLE_NAME")
    while (rs4.next()) {
    Timestamp timestamp2 = rs4.getTimestamp("expire_date");
    con1.close();
    catch (Exception e)
    e.printStackTrace();
    finally
    //ResultSet rs4 = null;
    //Timestamp timestamp2;
    Timestamp timestamp2 = rs4.getTimestamp("expire_date");
    if (timestamp2.compareTo(timestamp) < 0)  //sysdate < exp date
    return true;
    } else {
    return false;
    }

    Didn't you understand what BalusC said? You're closing the connection and then trying to use the ResultSet. The ResultSet will be closed when you close the connection so you can't use it anymore.
    You should close the connection last thing in your code, probably in a finally. And after you close your ResultSet and Statement.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • I can't print using airprint from my iPhone 4.  Everything with the phone and the printer and router are up to date.  I can print from my iPad 2 with no problems.  What's wrong with the iPhone 4?

    I can't print using airprint from my iPhone 4.  Everything with the phone and the printer and router are up to date.  I can print from my iPad 2 with no problems.  What's wrong with the iPhone 4?

    I just wanted to leave a note that it's working now. I'm not sure if it was the latest iTunes update that got it working or that i decided to start a new library instead of using the one i had backed up on Windows 8 (it didn't occur to me to check using the old library when i re-installed iTunes). But if anyone is having this problem, it might be worth trying again with a new installation of iTunes to see if the latest update works for you, and if not, try using a fresh library instead of a backup (by fresh library i mean discard your old library completely and start a new library, not just restore as new iPhone, a whole new library).

Maybe you are looking for

  • All sql

    [./solutions/atonx.sql] REM REM script ATONX.SQL REM ===================================== SET AUTOTRACE ON EXPLAIN [./solutions/saved_settings.sql] set appinfo OFF set appinfo "SQL*Plus" set arraysize 15 set autocommit OFF set autoprint OFF set auto

  • How to save filled in pdf

    taking online course with pdfs.  cannot save pdfs after filling in info fields.  help.

  • Flash player not recognized with Internet Explorer

    I have tried everything and cannot view youtube videos with IE explorer 10 or 9.  I had IE 10 and uninstalled this update to go back to IE 9. This did not help. I have removed and reinstalled Adobe Flash Player (latest version) 6 times. I have disabl

  • How do i install my photoshop cs4 without a cd player?

    I  purchased a new macbook pro without a cd player and I want to install my photoshop CS4 that i had on my other mac. I have the CDs. What is the best way to do this.

  • How do I put an app on my iPad from my iPad mini.

    I have bought an iPad mini and at the apple shop all the apps on my ipad1 were transferred to the mini. I have now purchased another app straight on to the mini, how do I put it on to my original iPad.