Generics with wildcard in constructor problem

Hi All
I have the following code
import java.util.* ;
public class MyClass
   public static void main(String[] argvs)
       List<?> li = new ArrayList<MyClass>();
       li.add(new MyClass()) ;
}I get a compile error on li.add(...) which doesn't make much sense to me, any suggestions ?
(I can fix this by replacing the wildcard with MyClass)
Thnx
LuCa

List<?> effectively means "A list containing a specific, but unknown subtype of Object". This is two-fold. It ensures that everything you get out from it is at least Object (this one is easy ;-)) and it ensures that everything that gets put in is of that specific, but unknown subtype. Since the compiler can't know if any given object is of this subtype (since it's unknown) it can't allow any object into the List.

Similar Messages

  • FTP - FCC - GUILDFTPd - Unable to pick up multiple files with Wildcard char

    Hi All, 
    I am not sure if my issue is strange or i may be missing something here. I am using FTP - FCC and using GUILDFTPd to connect to my local machine. This is working perfect if i don't use wildcard characters in file name but if i use them it is not picking up files. I have green in Channel monitoring and polling as mentioned for every 60 Seconds.
    I have tried both using/without using 'Advanced selection for source file'  and also checked 'Adapter specific message attributes'. The same is working if i specify exact file name. By the way, i have tried using '*' and '?' as wildcard character.
    Any idea or help in this regard is appreciated.

    I have tried with just basic. I mean, it works fine if i specify exact file name. The problem is only when i want to pick up multiple files using any wildcard character. No error in communication channel or in archive settings as the scenario working for one file without any wildcard.
    However, i have changed to NFS and it is working good even with wildcard characters.
    It seems there is a problem with GUILDFTPd which is not picking up files but no errror.
    Any ideas are welcome. Thank you both for the responses.

  • Multiple selection with wildcard in WAD

    Hello,
    How can I do filtering with multiple selection with wildcard in WAD 7 ?
    We have this problem in two seperate situation. The first is in the parameter screen where we want to filer the output with two wildcard. The first one we can put on the field and then go to the selection screen but what about the other ????. The second situation is in the report when we want to filter one of the columns with wildcard.
    I will appreciate if someone will open my eyes about this.
    Ilan

    Hello,
    you can use the * for wildcards in the BEx Web.
    For example 37* -> 370000 up to 379999.
    Buy,
    André

  • Fix for SOLR searches beginning with wildcard?

    All, I am having problems finding clear answers on if the above was corrected in ColdFusion 10. 
    I can't get my head around the idea of SOLR not allowing search criteria to begin with a wildcard.  I've seen a solution for reverse wildcard searching, which is great as long as I specify criteria for which I know the ending letters.  For example, if I am looking for all entries ending in "ing", I could do a search on "*ing", using the reverse wildcard to find "gni*".  I have yet to see, or come up with, a solution for a SOLR search with wildcards in the start and end of the criteria.  For example, lets say I am looking for any word with "fus" in the middle, such as "confusing" or "perfusing" or "profusely".  I would want to do a search such as "*fus*".  From what I understand thus far, this cannot be done in SOLR?
    Thanks,
    Tom

    ColdFusion will support whatever Apache solr supports as it is the underlying engine we are using.
    And Solr does support it: http://lucene.apache.org/solr/api/org/apache/solr/analysis/ReversedWildcardFilterFactory.h tml
    I think this is an egregious hack, but still, it's the way they've chosen to support it.
    Solr technically disables support of leading wildcards by default in the traditional query parsers due to concerns about query performance since it tends to select a large percentage of indexed terms.
    Be that as it may, this should be my decision, as the maintainer of the index, not your decision to blanketly disallow it.  If it's available, then one can use it if one choses, or not use it for the reasons you cite.  If you blanketly disallow it, you're removing the ability for me to make that decision.
    It's also a bit of a backwards compat issue, innit?  Verity allowed leading wildcards.
    Adam

  • Sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loop

    sir i have given lot of effort but i am not able to solve my problem either with notifiers or with occurence fn,probably i do not know how to use these synchronisation tools.

    sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loopHi Sam,
    I want to pass along a couple of tips that will get you more and better response on this list.
    1) There is an un-written rule that says more "stars" is better than just one star. Giving a one star rating will probably eliminate that responder from individuals that are willing to anser your question.
    2) If someone gives you an answer that meets your needs, reply to that answer and say that it worked.
    3) If someone suggests that you look at an example, DO IT! LV comes with a wonderful set of examples that demonstate almost all of the core functionality of LV. Familiarity with all of the LV examples will get you through about 80% of the Certified LabVIEW Developer exam.
    4) If you have a question first search the examples for something tha
    t may help you. If you can not find an example that is exactly what you want, find one that is close and post a question along the lines of "I want to do something similar to example X, how can I modify it to do Y".
    5) Some of the greatest LabVIEW minds offer there services and advice for free on this exchange. If you treat them good, they can get you through almost every challenge that can be encountered in LV.
    6) If English is not your native language, post your question in the language you favor. There is probably someone around that can help. "We're big, we're bad, we're international!"
    Trying to help,
    Welcome to the forum!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Help with add file name problem with Photoshop CS4

    Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
    Script follows:
    // this script is another variation of the script addTimeStamp.js that is installed with PS7
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.INCHES;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "Lower© ";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = " ";
    // Set font size in Points
    myTextRef.size = 10;
    //Set font - use GetFontName.jsx to get exact name
    myTextRef.font = "Arial";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 0;
    newColor.rgb.green = 0;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 10, 99);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

    you might want to try the scripting forum howard:
    http://www.adobeforums.com/webx?13@@.ef7f2cb

  • Mid 2011 mbp i7 with a SSD has problems, including grey screen/blue screen/beeping/freezing when I stream live video (i.e. watch espn or time warner cable) Help? Ideas?

    Recently my Macbook Pro (June 2011, i7, 8gb RAM, 512gb SSD, AMD Radeon 6750, Mountain Lion - since July - currently 10.8.2) has been presenting me with an array of problems, usually initiated when I am streaming live video. I was streaming Time Warner Cable on 12/9 and it gave me what looked like the blue screen of death.  It started up after about five attempts that time. The other day, after about a week of not using the computer, it wouldn't boot past the grey screen. I (option) started it and it gave me two boot choices, the regular HD and a "10.8 restore" option.  The HD gave me the grey screen and the restore option gave me the dark blue screen. I reset PRAM and that didn't work.  After a force (x) start it worked.  Today, I was using "Watch ESPN" and the screen froze and the computer did some kind of repeating RAM beep or something.  I rebooted and it started up fine.  I'm not watching any videos anymore, but this is a problem since the primary purpose for my mbp is video editing. I'm still under AppleCare but I find more solid answers in the forums or at least better questions for the AppleCare people.
    Anybody have similar experiences, or a solid idea of what the heck has happened to my machine?

    I'm not really sure what method that person was talking about. I just read he had a successful install so I posted it.
    But I'll hazard a guess
    1. copy your entire drive to a backup drive
    2. boot into that drive and test it out - make sure its a flawless backup, it works, and the hard drive has no problems
    3. eject that drive, disconnect it and reboot into the leopard install dvd
    4. erase your main hard drive using disc utilities on the leopard install dvd -- you've made a backup, made sure that backup was good, and disconnected it so it's currently safely disconnected from the leopard install you're about to do. Also, on the hard drive you're erasing and installing leopard on to, many people recommend "Zeroing" it as well as erasing it. That option is part of the erase function in disc utilities on the leopard install disc.
    5. do a clean install of leopard
    6. follow step 4 from that original post exactly as that person described to do.
    7. read the rest of what they said
    That's pretty much it. With the backup/erase/clean install/import/ you pretty much get everything you need exactly the way you want it with very few things missing -- and you've done this over a clean install. Plus that poster did mention that you can select what you want to import from your backup hard drive.
    It sounds like its a "clean install" method that gives you control via "import from machine" option in the installer. Control over what parts of your "old mac" you want to import into your "new leopard mac".
    Hopefully that helps. It sounds more involved, but its actually pretty quick and provides you with a perfectly save backup in case anything goes wrong with the leopard install.

  • I install LION on my mac pro 2008 and it's alway's pop with " there was a problem connecting to the server " Time Capsule" .How can i remove this popup. My Time machine is working fine and also rename it. But the popup keeps on coming with the old name.

    I installed LION on my mac pro 2008 and it's alway's pop with " there was a problem connecting to the server " Time Capsule" .How can i remove this popup. My Time machine is working fine and also rename it with less than 7 karakters. But the popup keeps on coming with the old name.

    I have a BT Infinity router plugged into the Time Capsule, not sure where the radio settings are?
    They are able to use the network settings of the TC i.e. they can connect to the internet via the wifi through the TC but when they try and connect to the AirPort Disk this is where it is not allowing a connection.
    I don;t have the drive shared out at all at the moment, is this necessary?  How do I do this if so?
    I have attached the screen shots of all the settings.
    Thanks again for your help.

  • 9 month old Zen Micro with the headphone jack problem

    So, I've been putting up with the headphone jack problem for a few months now, and i've finally decided to get it repaired or fixed. I emailed Creative a few months back and they told me to send it in. My question is, since I am out of warranty, will they repair the unit or send me a whole new one all together?
    thanks,
    mike

    Actually, I just sent in my 7-month old Micro in b/c of the headphone jack problem and they sent me a brand new shrink-wrapped one. They <EM>didn't </EM>charge me for anything. All I had to do was wait 2 weeks for them to send it back to me (grueling but doable) and pay about 2.44 for shipping the micro to them. So now I'd have three batteries if it weren't for the fact that one of them swelled up; I have NO IDEA how that happened. So yeah I guess the point of the post is that you don't get charged anything even if you're out of the 90-day labor warranty.

  • I have iphone 4s with iO6. My problem is I can no longer update my apps since "cannot connect to itunes" always shows on my screen when i try to. Tried fixing by changing the dates, turning off location as suggested in some forums but both didn't work!

    I have iphone 4s with iO6. My problem is I can no longer update my apps since "cannot connect to itunes store" always shows on my screen when i try to. Tried fixing by changing the dates, turning off location as suggested in some forums but both didn't work!  Please help!! Thanks.

    You can not merge accounts.
    Apps are tied to the Apple ID used to download them, you can not transfer them.

  • My IPOD Classic Video 5. Gen. showed videos, but now it does no longer show them, instead i see a black picture on my IPOD and it doesn`t work. I have to restart it every time, i try it. i restore the software with itunes, but the problem still exists.

    My IPOD Classic Video 5. Gen. showed videos, but now it does no longer show them, instead i see a black picture on my IPOD and it doesn`t work. I have to restart it every time, i try it. i restore the software with itunes, but the problem still exists.
    The Videos are showed up front 4 months, but now they are no longer to be seen. When you star a video first the hard drive starts, but then it stops and hangs up. I have to restart it, starting with the apple logo....

    Here is what worked for me:
      My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.

  • Generic with holdingtac report T Code : S_P00_07000134

    Hi,
    I am executing the generic with holding tac report RFIDYYWT ( T Code S_P00_07000134 ).
    the report should
    1) All vendor invoices paid
    2) All credit memos paid
    3) All open down payments i.e. down payment paid but not yet settled against a final invoice.
    But , I am getting only 1 & 2 documents ( above mentioned ) it means that I am not getting the All open down payments documents in the report output.
    please do the needful ASAP.
    Thanks in Advance
    Arjun

    Resolved by using Check Register

  • How to create a generic with iMovie for iPad?

    How do i create A generic with iMovie for iPad?

    luckyuis wrote:
    Hi All,
    > I have generated a report showing data for past 12 months and after that i need to include a chart showing Month on X axis with data for past 12 months ..for example if i run the report for June 2011 then on the chart it should take as june 11..>may 11..>april 11........so on june 10 with respect to other values
    >
    > fyi .. i am using type: Numeric Axis..> Date Axis line chart and created seperate formule on top of date field to get past 12 months data
    >
    > Please advise how can i do that on the chart
    >
    > Thanks much,
    > Lucky
    Once you pull the data, goup on the date monthly, most recent first ,and then graph the summaries in the group.

  • TS3276 Hey. I have problems to send e-mail with Mail. The problems is I need to un active ssl ,... but when I do this,... automatically,. its active again????. Whta can i do

    Hey. I have problems to send e-mail with Mail. The problems is I need to un active ssl ,... but when I do this,... automatically,. its active again????. Whta can i do

    Try posting this in the 10.7 Mail forum. You'll get more help there.
    DALE

  • Incorrect warning for import directive with wildcard

    Some (all?) imports with wildcards seem to be getting incorrect warnings. For example, if I do:
    import flash.events.*
    I get a warning "The import flash.events.*" is not used locally, which is not true, since I am using ProgressEvent, IOErrorEvent, SecurityErrorEvent, etc. in the same file. This did not happen in FB 4.6.

    I created an account on the bugs site and no amount of searching (or using the direct link) will reveal this 'bug' entity.
    I too am having a similar difficulty (at least I think it is), though no wildcard character is involved.
    In FB7 I have a Mobile Project created fresh after installing FB7. The main application MXML type was selected within the wizard when creating the project, and that type was TabbedViewNavigatorApplication. I created a directory under the 'src' directory by the name of 'skins' and started a fresh .as file.  As quoted.  (actually, I'm going to post a screenshot as I'm incredulous that even in advanced editing mode, that a forum -> on programming and development <- seems to have no obvious way to insert formatted code and indeed ignores such tags when added in the HTML view of the editor     If that functionality is there, it's -far- from obvious or intiutive. )

Maybe you are looking for