String[] sa = {"one", "two", "three"} with other types, too?

String[] sa = {"one", "two", "three"}
is a nice abbreviation in instantiating an object and initialize with multiple elements in one line of code.
are there similar syntax abbreviations for e.g. HashSet?
                HashSet hs = new HashSet();
                hs.add("one");
                hs.add("two");
                hs.add("three");is not very handy ... (especially for much more elements than 3!)

>                 HashSet hs = new HashSet();
hs.add("one");
hs.add("two");
hs.add("three");is not very handy ... (especially for much more
elements than 3!)Yes, that might not be very handy. But if you have many elements, String[] sa = {"one", "two", "three"} won't be very handy either. Anyway, initialising collection with large numbers of hard-coded items isn't something you do very often.
If you absolutely want to write it in one line in your editor, just do so:
HashSet hs = new HashSet();hs.add("one"); hs.add("two");hs.add("three");

Similar Messages

  • Is t-mobile contract free iphone6 unlocked or not outside usa?? Is any one using it with other carriers??

    Is t-mobile contract free iphone6 unlocked or not outside usa?? Is any one using it with other carriers??

    i have a contract free t-Mobile iPhone 6 plus which Im using on ATT - i havent yet tried it outside the USA - but last year i bought a contract free T-Mobile 5s and it worked fine outside the US - so im hopeful nothing has changed

  • Whenever i play something or do something in mozilla, it automaticly goes back to homepage. the problem is with other browsers too? Could anybody help.

    Whenever i play something or do something in mozilla, it automaticly goes back to homepage. the problem is with other browsers too. It is very annoying . It does it randomly

    Do you mean that Firefox closes and restarts automatically?
    If you have submitted crash reports then please post the IDs of one or more recent crash reports that have a "bp-" prefix:
    *bp-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    You can find the IDs of the submitted crash reports on the <i>about:crashes</i> page.
    *You can open the <b>about:crashes</b> page via the location bar, like you open a website, or open the crash reports page via "Help > Troubleshooting Information".
    See:
    *http://kb.mozillazine.org/Mozilla_Crash_Reporter
    *https://support.mozilla.org/kb/Mozilla+Crash+Reporter

  • Two iTouches; iTunes trying to overwrite one of them with other's info

    I was trying to add music to my two kid's iTouches.
    I didn't realize I had my son's plugged in and iTunes asked if it should recognize this iTouch as my daughters. (I don't think I'd sync'd his before)
    I said yes and then realized it was my son's iTouch.
    I stopped the sync and didn't loose anything (OHMYGOSH- he would have been mad and rightfully so).
    However, now when I try to re-sync his phone it recongnizes his phone as HER phone and tries to overwrite it.
    How can I stop it from doing that so I can sync his iTouch/back it up so forth?
    I was thinking somehow to see what UDID is was recognizing, deleting her iTouch from my iTunes or something momentarily.
    Thoughts?

    My movies won't download, one says waiting the other processing it has been like that for over 14 hours, and I can't delete them, any suggestions?

  • How to do a report on one multiprovider along with other Infocube

    Hi ALL,
      I am new to this field. Can any of you u tell me how to report on two infoproviders one being the multiprovider and the other being the info cube.
    Thanks,
    Vinay

    Hi
    You can't do reporting on multiple Info providers . What you can do in u'r case is have your cube inculded in the Multiprovider you are refering to , or else create a new Multiprovide with all the Cubes and DSOs from which you need data for reporting . The latter method better case it would not effect any of your existing queries on the Old Multiprovider .
    Rajesh

  • A simple one - two - three help

    I am having trouble just getting out of the blocks, or getting started with this. I'm not proud of that but it's my situation. I find I can't move slides, am having trouble getting them in the program and on and on for folks that don't know what they're doing and need help.
    All I want to do is present some family photos with music for a birthday on a DVD for playing at their home on their TV. If anyone knows of and can point me to help other than the regular help which is so heavy with all the many features of Keynote I would thank you so much. What I need is a simple just "getting started" 1-2-3 type procedure with some examples, I sure would appreciate it. Thanks a bunch, God bless.

    Ben,
    You are half correct with your thinking. The problem is two fold. The basic Adobe Reader program will only allow a user to view a form in all reality. Yes you can fill it in and print it, but saving the completed form is not something Reader is allowed to do on its own. The exception to this is having a Reader Extended form. A reader extended form has been given additional rights that allows the basic version of reader to perform additional tasks, that normally require Adobe Acrobat to accomplish. In order to be able to save your completed form you will need to either open the form with Adobe Acrobat, or reader extend the form first if you are going to do the same thing with Reader.

  • How do I share one Iphoto library with other User accounts on the same iMac

    I have created a shared Iphoto Library. When I add this to one of the user accounts, it copies all the pictures instead of sharing the same library. The result is that it uses memory.
    Is it possible to create a shared library that is shared by all the users without actually copy all the pictures to each users Iphoto library?

    Hi MikaelK,
    SHARING IPHOTO LIBRARIES
    Sharing libraries between users on the same local network
    You can also share a library on the same machine between users the same way.
    Sharing libraries between users on the same machine...
    -both users must have sharing enabled in their iPhoto Preferences
    -both users must be logged in and have iPhoto running
    -Remember that you can only view the other library. You can't edit the photos or play the saved slideshows or view the made books or burn them to CD or DVD. The books and slideshows will show up as an album. You can play that album as an "on the fly" slideshow. You can drag images from the sharing library to your library in the source column to import them to your library. You can then edit, add to albums, books, slideshow, etc.
    Sharing links from Apple....
    Sharing your photos between computers
    About shared photos
    Turning off photo sharing
    Looking for shared photos
    SHARING ONE IPHOTO LIBRARY BETWEEN USERS ON SAME MACHINE
    You can try one of these three methods:
    1- Use iPhoto Library Manager-the paid version
    The documentation page will give instructions on how it is done.
    2- Sharing one iPhoto library between several users on one machine
    3- Share an iPhoto Library in tiger Using ACL's
    4- I have also read about ShareAlike
    There is no other info on the site about how it works.
    I strongly urge anyone wanting to try any of the methods for sharing one iPhoto Library folder among more than one user to backup all iPhoto Library folders before attemptin anything.

  • Student licens for one program together with other licens

    I have the "light version" of Adobe Suite through my work place (psd, indd, ai, bridge). Now I need AfterEffects wich is not covered in my work licens. How can I add a licens for After Effects without having to pay for all the programs I already have? I am also a student, can i have a student licens for a single program and use it together with my work licens?

    Moving this discussion to the Adobe Creative Cloud forum.
    Danielajuvall are you wishing to utilize your own membership to After Effects on the same computer you are utilizing a Creative Cloud for Team/Enterprise membership?

  • TS2634 Why are my earphones crackling in my iPad? They work on my iPod and it happens with other earphones too

    Recently on my iPad when I listen to music with my earphones, they start to crackle! It does it with all of my earphones! Why does this happen( plus its fine on my iPod)?

    It took most of the morning but I worked out what was causing the issue... the PNG files were! Still don't understand why though...
    The correct PNG files are using "sRGB IEC61966-2.1" colour profile and the wrong ones were using "eciRGB v2" (the one I am supposed to be using from the company).
    The InDesign document colour profile is set to "eciRGB v2" on all files (including embedded into imported images from PS and Illustrator).
    The PDF setting (also a custom one from the company) Output Colour Conversion Destination set to "sRGB IEC61966-2.1" opening up the PDF in PS Colour changed to "eciRGB v2" on files not working... don't know why. I even tried changing the InDesign colour profile to "sRGB IEC61966-2.1" before exporting PDF, still opening up in PS as "eciRGB v2"... tried convert to profile in PS several times, crash it every time, also tried on other Mac, still crashed.
    Changed colour profile in InDesign back to "eciRGB v2". Checked the imported assets, begun trial and error, removing photos then making PDF to see if they were causing the problem, and so on... four of the ai files were causing the PDF to open as "eciRGB v2" instead of "sRGB IEC61966-2.1".
    I checked the settings in these ai files, they are exactly the same as the ai files in all the pages which are working, so still at a loss as to why these ones we're causing trouble when the others weren't. After checking several things, transparency, isolated blending, knockout groups etc I changed the edit colours and converted to RGB saved and updated, problem solved... made PDF, open in PS as "sRGB IEC61966-2.1" re-imported, remade PDF, perfect! Lovely and bright!
    Why!? And please, any suggestions on a better workflow to save me having to do this ever again much appreciated.

  • How to use the JE database with other data types than byte arrays?

    Hi! I searched the javadoc of Berkley DB JE, for a way to introduce entry (but I need also retrieve) data with other type than byte arrays, e.g. String, or anything else, as int may be, etc.
    Still, I didn't find any such way, because the main (only?!) method to entry data into an open database - according what I found in javadoc - is:
    "public OperationStatus put(Transaction txn, DatabaseEntry key, DatabaseEntry data) throws DatabaseException"
    and both this and the corresponding method for retrieves, are based on the same DatabaseEntry type, which allow only entry data on byte[] support.
    What if I need to use Strings or int, or even char? I must do a special conversion from these types, to byte[], to use the database?
    Thank you!

    On the doc page (this is also in the download package),
    http://download.oracle.com/docs/cd/E17277_02/html/index.html
    see:
    Getting Started Guide
    Java Collections Tutorial
    Direct Persistence Layer (DPL)
    All of these describe how to use data types other than byte arrays.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Combining two single recordset into one two column recordset

    Hi Forum
    Assume we have three types , each 'table of'
    CREATE OR REPLACE type type1 as table of number ;
    CREATE OR REPLACE type type2 as table of varchar2 (255);
    CREATE OR REPLACE TYPE TYPEVALUE AS OBJECT
    (object_type number ,
    object_value varchar2(255)
    resultset1 type1 := type1() ;
    resultset2 type2 := type2() ;
    resultset3 typevalue := typeValue3() ;
    I want to populate records of resultset3 from resultset1 and resultset2 , using resultset1 for first column of record and resultset2 for second column.
    One way is to do for loop but I don't want to use this.
    I need something similar to resultset3 to use it dynamically in select statement to do MINUS operation with another resultset . I think things like MULTISET, COLLECT, CAST can achieve what I want to do.
    Can you please help me to have a select statement that combines two single column rowset and put into a two column recordset.
    Thanks

    Hi,
    You can do something like this:
    SQL> create or replace type type1 as table of number;
      2  /
    Type created.
    SQL> create or replace type type2 as table of varchar2(255);
      2  /
    Type created.
    SQL> create or replace type typevalue as object(object_type number, object_value varchar2(255));
      2  /
    Type created.
    SQL> create type typevalue_tab as table of typevalue;
      2  /
    Type created.
    SQL> ed
      1  declare
      2     resultset1 type1 := type1(1, 2, 3, 4, 5);
      3     resultset2 type2 := type2('one', 'two', 'three', 'four', 'five');
      4     resultset3 typevalue_tab;
      5  begin
      6     for l_res in (
      7        select typevalue(t1.col1, t2.col2) as col
      8        from (
      9           select column_value col1
    10           , rownum rn
    11           from table(cast(resultset1 as type1))
    12        ) t1
    13        , (
    14           select column_value col2
    15           , rownum rn
    16           from table(cast(resultset2 as type2))
    17        ) t2
    18        where t1.rn = t2.rn
    19     )
    20     loop
    21        dbms_output.put_line(
    22           'Object Type:  '||l_res.col.object_type||' '||
    23           'Object Value: '||l_res.col.object_value
    24        );
    25     end loop;
    26* end;
    SQL> /
    Object Type:  1 Object Value: one
    Object Type:  2 Object Value: two
    Object Type:  3 Object Value: three
    Object Type:  4 Object Value: four
    Object Type:  5 Object Value: five
    PL/SQL procedure successfully completed.All the work here is done in SQL so it should work similarly if you have these things defined as nested table columns in the database.
    However, there is a caveat here: the lines highlighted in bold above are defining an arbitrary ordering for the nested table elements using rownum, as there is no concept of ordering within a nested table. You should change this part of the query to whatever makes sense in your environment, otherwise this solution cannot be guaranteed to be correct. Another option would be to use VARRAYs, as they will retain the order of elements.
    cheers,
    Anthony

  • Item category ZLCO L2N cannot be invoiced with billing type ZLR.

    Hi experts,
    I made one sales order with order type ZLCO.(Order relevant Billing type). At the time of doing VF01 i am getting the following error Item category ZLCO L2N cannot be invoiced with billing type ZLR.
    Any one guide me to solve this problem.
    Regs.
    SR

    hi
    Kindly check the below
    1.Check the copy control configuration  in the t code VTFA
    2.Check the t code VOV8 sales document configuration
    Regards
    Damu

  • JFileChooser and other types of "file" systems

    Good afternoon...
    just wondering how reasonable it would be to modify JFileChooser to work with other types of file systems. such as .zip archives, remote FTPs, etc.
    any ideas where i should start?
    i even want to use this for something that doesn't contain files at all, but the analogy works perfectly.
    Schultz.

    Here's how to view remote files with ftp:
    What does FileSystemView view? http://www.crocodile.org/listok/2/WhatDoesFileSystemViewView.shtml
    Cheers
    Tue

  • Dock sometimes jump from one screen to 2nd other.

    When I am using a second monitor (21" Dell) with my 15" MacBook Pro, why does the dock sometimes (often) jump from the bigger monitor back to the MacBook?  This happens even when System Preferences/Displays/Arrangement indicates that the dock is still on the Dell monitor, but it is not.  In the System Preferences/Displays/Arrangement, I have to 'move' the dock to the MacBook screen and then back to the Dell.  Movement of the dock happens with other monitors too (e.g., Viewsonic).  Thanks for any advice on solving this.

    I get this behaviour for what ever screen the cursor is on.
    But generally only when the cursor reaches the bottom of the screen.

  • In the NI Library VI: Extract Numbers, the string control is automatically loaded each time the VI is opened with "Counting to five: one 2 three 4.0 five. Where is this string data coming from?

    Even after deleting the string "Counting to five: one 2 three 4. five." from the string control and replacing it with another string the original string returns after the VI is saved then reopened. Where is this string data coming from? I've attached a copy of the library function. I've been able in my application to get around the problem by replacing the string control with a string constant. But I'm still curious as to what's going on.
    Thanks,
    Chuck
    Solved!
    Go to Solution.
    Attachments:
    Extract Numbers Test.vi ‏9 KB

    Chuck,
    String control has been set to default with the string you are seeing.  To change this, enter the new string, right click the control and select
    Data Operations>>Make Current Value Default
    Now save your vi.

Maybe you are looking for

  • Color management does not work as expected, different from v3.6

    Color management seems to work differently than FF 3.6. On a home page, I have a background graphic that is supposed to blend into the page background. I have left that graphic untagged so the blending will work in all browsers regardless of color ma

  • ABAP Proxy To XI

    Hi All, I hope i can get an answer to lingering problem that we have currently. We manage to configure to have XI --> ECC 5.0 (through Proxy / XI Adapter) We have another scenario where we are using ECC 5.0 through ABAP proxy to send messages to XI.

  • Problem getting iWeb 09 to publish without creating its own directory insid

    *I made a website using iWeb 09 and I am very new to the whole MAC experience, so obviously I have no idea what I am doing.* *Anyway--I am hosting my website on bravenet.* *When I go into my server settings to enter the FTP settings, everything goes

  • File Management

    Hi. This is my first time at the forum for many years. I use and own two computers, one with Win98se and one with Linspire 4.5. I gave my wife a G4 iMac for her birthday about 4 years ago because Windows was too confusing for her. She is able to do m

  • IOS upgrade failed, forced to restore--but how...?

    Well, I plugged in my iPhone4 last night, set it up to upgrade, and left it alone for a few hours. Just before I went to bed, I checked on it, and there was a popup that said "unable to upgrade" (or words to that effect). My iPhone was in the cradle