Is it possible for an Array to have zero element??

As the subject stated, is it possible for an Array to have zero element apart from being null??
because if I dont assign an Array to any amount of elements, the Array is always null. And, that is the reason why I never see Array.length being zero.
Any body can explain??

As the subject stated, is it possible for an Array to
have zero element apart from being null??Well, let's see. new int[1] creates an array with one element, so if it IS possible to have an array with zero elements, how do you suppose you'd do that?
Okay, right.
Now, what happened when you put that into a .java file and compiled it?
because if I dont assign an Array to any amount of
elements, the Array is always null.If you don't assign a reference to an array to your array variable, (i.e. myArr = ... then it will be null (if it's a member variable, but undefined if it's a local).
But null and empty are not the same thing. Remember, there's your variable, and there's the array it points to.
Why do you think that the array it points to must have >= 1 elements?
I'm not saying it's okay to have zero elemnts. And I'm not saying it's not.
I'm asking you to examine your logic for why you think zero elements is not possible (said logic is faulty). And then I'm asking you to do an experiment to test your theory.
And, that is the
reason why I never see Array.length being zero.If you never see array.length being zero, it's because none of the arrays you looked at had zero elments. That doesn't tell you that arrays can't have zero elements.
So far, you have neither theory nor observations to support either view.

Similar Messages

  • In a hierarchical query, is it possible for a row to have more than one immediate ancestor?

    Hi
    Question:
    In a hierarchical query, is it possible for a row to have more than one immediate ancestor?
    Answer:
    No
    No?  Surely, it's yes?
    Thanks,
    Jason

    As Frank pointed out already hierarhical most often means a tree (data structure) to deal with.
    There must usually be just one boss (the root) in which case the answer is no.
    Something to read: http://en.wikipedia.org/wiki/Tree_(data_structure)
    You can find out Solomon spoke about a generalization therein.
    Related to forum troubles:
    If I login first thing after reaching forum, the behaviour is rather consistent - I'm allowed to post answers, otherwise ...
    Regards
    Etbin

  • Is it possible for a JList to have multiple columns..

    And also at the same time have its header also.
    Thanks in advance.

    Try this
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.text.*;
    public class SOSTester extends JFrame {
         public SOSTester() {
              JFrame thisFrame = new JFrame("Testing");
              Container thisCont = thisFrame.getContentPane();
              thisCont.setLayout(new BorderLayout(5,5));
              //// Start Testing
              String[] testList1 = new String[]{"AB","CD","EF"};
              JComboBox jcb = new JComboBox(testList1);
              jcb.setRenderer(new myRen());
              thisCont.add(jcb);
              //// End Testing
              thisFrame.pack();
              thisFrame.setBounds(200,200,400,50);
              thisFrame.setVisible(true);          
         public static void main(String args[]) { new SOSTester();}
    class myRen extends JPanel implements ListCellRenderer
         JPanel testPanel = null;
         //JPanel thisPanel = null;
         JLabel text1 = null;
         JLabel text2 = null;
         myRen()
              text1 = new JLabel("",10);
              text2 = new JLabel("",10);
              testPanel = new JPanel();
              testPanel.setLayout(new GridLayout(1,2));
              //testPanel.setLayout(null);
              testPanel.add(text1);
              testPanel.add(text2);
              //thisPanel = new JPanel(new BorderLayout(0,0));
              //thisPanel.add(testPanel, BorderLayout.CENTER);
         public Component getListCellRendererComponent(JList list, Object value, int idx, boolean isSel, boolean hasFocus)
              if (value!=null)
                   text1.setText(((String)value).substring(0,1));
                   text2.setText(((String)value).substring(1,2));
                   //text1.setBounds(5,0,20,25);
                   //text2.setBounds(25,0,20,25);
              testPanel.setBackground((isSel)?list.getSelectionBackground():list.getBackground());
              testPanel.setForeground((isSel)?list.getSelectionForeground():list.getForeground());
              //testPanel.setSize(30,30);
              return testPanel;
    }

  • I have an iPhone 4s that is no longer active on my account. I recently upgraded it after completing a 2-year contract. Is it still possible for me to have the iPhone 4s unlocked even though it is no longer active on my account?

    I have an iPhone 4s that is no longer active on my account. I recently upgraded it after completing a 2-year contract. Is it still possible for me to have the iPhone 4s unlocked even though it is no longer active on my account?

        Great question missmar23. You can contact our Global Support department at 1-800-711-8300 to discuss the details for your device.
    KinquanaH_VZW
    Follow us on Twitter @vzwsupport

  • Is it possible for a mac to run across a Windows based server such as in a school, and still be able to access all networked folders? I have been told that macs can only read down a certain number of folders

    Is it possible to run a mac on a windows based server? We have a server based on Windows 7 in our school, and our techies are reluctant to let me buy a mac as they say macs can only read a number of folders deep, which would preclude me from accessing shared folders on our servers. Is this true, and is there a way round this? I would eventually like to get a suite of macs, but because all our resources are on the server, I have to be able to access them.
    Thanks for any help,
    Mike

    I have found that both Linux and Mac (unix) are capable of reading "deep" folders while win 32 will have issues, your it people are clearly wrong.  I run a network with both win/mac. And as long as the win servers/pc's that have shares are set to allow apple file sharing in their folder properties.   And the macs are set to allow smb there should absolutely no trouble with you accessing anything across the platforms, heck, from a Mac to a win pc on some occasions you don't even need to include a "domain" name to log on to, and you can create aliases and make your own shortcuts etc... So you don't have to manually connect each time you boot up etc... But that's all personal preferences I suppose.
    All I can tell you is that, I do it on a daily basis managing a small business. So your answer is yes you can.

  • TS3297 Is it possible for itunes on my MacBook Pro to play songs off my networked WD external hard drive and sync to my iPhone? I prefer to not keep all my music on my laptop and I don't want to pay $25 a year to access my songs if I don't have to.

    Is it possible for itunes on my MacBook Pro to play songs off my networked Western Drive external hard drive so I can sync to my Mac to my iPhone? I do not want to keep any music on my laptop and I don't want to pay $25 to itunes match a year to access my songs if I don't have to.

    Hi turingtest2,
    Thank you for replying.  I've been looking at your posts about setting up iTunes using an external drive.  A bit of background info.  My old computer broke down, so I got a new one from work.  I've always kept my music files on my external drive (I have around 170GB of music).  I didn't follow the suggestions in the "migrate iTunes library" post because my old computer died on me.  However, I've looked at your posts about lay out of the iTunes folders.  Before connecting to iTunes on the new computer, I had reorganized my iTunes folder on my E: external drive, and created an iTunes folder which contains an iTunes Media subfolder.  The music files are in a Music folder, which is in the iTunes Media folder.  I've also put the following files in my iTunes folder: iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, iTunes Music Library.xml, as well as sentinel.  I then followed the advice you gave bmw99 on 2 Nov 2013 at 9.58 (sorry, can't copy the exact answer). 
    Just to clarify:  I'd like to keep all my music media on the E: external hard drive (the computer hard drive is too small), and I'm aware i might never have my playlists back, and that all the songs in my library might be ticked.  However, I don't want my library to be duplicated. 
    I'm at work at the moment, but will be back home in about 10 hours, so I can be more specific about folders / files names. 
    I'm glad you picked up my message and greatly appreciate your help.
    Patrice

  • Is it possible for the Adobe to put video instructions on these following things as my professor works on CS4 and I have CS6,it is really confusing for me to follow the disparitie between the two.

    Is it possible for the Adobe to put video instructions on these following things as my professor works on CS4 and I have CS6,it is really confusing for me to follow the disparitie between the two
    Modifying the header
    Changing page background color
    Changing sidebars in CSS
    Adding/changing a Spry link's background and hover colors in navbar
    Formatting headers in split view
    Deleting placeholder copy in the content container
    Inserting a video in a table
    Changing table background color
    Formatting text in the content container
    Format hyperlinks in CSS
    Insert page anchors and link to them with navbar hyperlinks
    Enter text in footer with a hyperlink
    Insert and format headers
      Use of a color picker (Color Cop)

    Use CS6 Help (F1).  Those are the most up to date articles for your product version.
    <Changing page background color>
    We've already told you how to do that with CSS code.
    <Deleting placeholder copy in the content container>
    Placeholders are deprecated.  Adobe removed them.
    <Inserting a video in a table>
    Insert > Media > HTML5 Video
    <Insert page anchors and link to them with navbar hyperlinks>
    Named anchors are deprecated in HTML.  Adobe removed them from DW.  Use Div IDs instead.
    Why are you taking a course that teaches outdated methods in CS4 which is no longer supported?
    Nancy O.

  • TS4498 Is music created in logic pro compatible with the logic pro x ? for instance if you have created something in logic pro and wont to add or tweak it a bit is that possible?

    Is music created in logic pro compatible with the logic pro x ? for instance if you have created something in logic pro and want to add or tweak it, is that possible? I suppose you would need the original logic folder?

    Yes it is more or less compatible, except the use of 32 bit plugins, which is prohibited from now on. So although you're able to open Logic projects as far as down to v5 I believe, it is advisable to remain for 'adding and tweaking' in your pre LPX environment.
    Have a nice day!

  • What does this statement mean: "There is a problem with your authentication, possibly due to inactivity. For your safety, you have been logged out and must sign in again to continue?"

    I am able to make it to the site for about 2 seconds and then I am quickly logged off and the statement, "There is a problem with your authentication, possibly due to inactivity. For your safety, you have been logged out and must sign in again to continue."
    I don't have a clue as to the problem but since this is impacting my participation in these classes and ultimately could have a negative impact on my grade, I am more than a little concerned!

    Have you allowed this site to set cookies?

  • Hii all, I just bought an used iphone 5c from an user and only after a few weeks realised that it got activation locked. He might be unaware of that. Is it possible to get back to him and unlock the device for me as i have not contacts with him presently.

    Hii all, I just bought an used iphone 5c from an user and only after a few weeks realised that it got activation locked. He might be unaware of that. Is it possible to get back to him and unlock the device for me as i have not contacts with him presently.

    Well first you need to sync your iPhone 4 with your Mac/PC so that it will transfer all your music, apps, podcasts, etc. Then sync your iPod Touch and the media you selected during the sync should be there on your iPhone. If you have difficulty in transferring media from iPhone to your computer, try softwares like TransCopy. They will help in transferring data from your iphone to your computer. Dont forget to check that all the transferred data is in the iTunes media folder so that the iTunes can locate the files. Link to Transcopy software :
    http://www.copytrans.net/copytrans.php

  • Is it possible to attach photos to a form prior to submission?  For example, if I have an employee in the field completing a property inspection, can photos of the property be submitted along with the form?

    I have to inspect properties for my business and have created a form that describes the condition of the property.  This form is great for my agents in the field, however, it would be really great if they could attach photos of the property to accompany the submission.  Is this possible?  Can it be considered on the wish list?

    Hi,
    Yes, you can create a file attachment field in the form and have your employee upload the pictures.
    Thanks,
    Wenlan

  • HT1222 Is it possible for me to update to new version if i have a gevey sim?

    Is it possible for me to update to new version if i have a gevey sim?

    My Airport Card Info. is
    Wireless Card Firmware Version: 9.52
    can you teach me how to connect in a WPA personal security?? Please??
    Because our router only has WPA and WPA2 and neither of the settings, after i put in the password, would connect to the internet... It would only gives me an error message "the wireless network (name of the network) does not support the requested encryption method".
    I am also trying to connect this Ibook into the personal hotspot feature of Iphone 4s but it is still not recoginizing the security settings. It will give me the same error....
    Thanks for the message anyways...
    So what is the next upgrade for OS X 10.4.11??

  • If I have an airport extreme and a time capsule is it possible for seamless switching between the 2 when a signal is weak or drops Main reason is as I move from my first floor to my attic office and would like to place one (airport extreme)downstairs and

    If I have an airport extreme and a time capsule is it possible for seamless switching between the 2 when a signal is weak or drops
    Main reason is as I move from my first floor to my attic office and would like to place one (airport extreme)downstairs and time capsule upstairs to get complete coverage

    In theory, yes. If you configure the two base station into either an extended or roaming network configuration, you should be able to walk a laptop between routers and the laptop should attempt to connect/reconnect to the base station providing the stronger signal ... but, in reality, this is not always 100% true.

  • I have an ipod touch 4 gen.Is it possible for me to use the internet with bluetooth?

    I have an apple ipod 4 gen.Is it possible for me to use the internet using bluetooth?helpp!!!

    Yes but only to tether to an iPhone.  The iPhone must have the optional tethering data plan.

  • I have 160gb of music on my Classic, 6th Gen (I think) I've just bought it. Is it possible for it to play my songs in a random order, one or two from different albums?

    I have 160gb of music on my Classic, 6th Gen (I think) I've just bought it. Is it possible for it to play my songs in a random order, one or two from different albums?

    To add to what Stonerock has mentioned, you can either create Playlists in your iTunes Library, containing exactly what you want, and then Sync them to your iPod, or you can use the iPod Classic's On-The-Go feature.
    Reading between the lines, I'm going to assume for now that you want to be able to create your preferred listening list while "out and about" - so not near your iTunes library. (You have posted in iPod Classic, after all.) You can do this with the On-The-Go Playlist.
    Look in the Playlists menu on the iPod. It probably contains the Recently Added, Recently Played and other pre-made Playlists that you see in your iTunes Library. At the bottom of the Playlists list, is the On-The-Go showing 0 Songs. Scroll down to it and press the Select (centre) button. The screen will give you instruction on adding songs to the On-The-Go Playlist.
    Basically, if you press-and-hold the Select (centre) button, while highlighting a song, the song title will blink as it is added to the On-The-Go Playlist. Try it, then go back to Playlists/On-The-Go and notice that it will now say 1 Song. (Note, you cannot add a "now playing" song to the On-The-Go Playlist.) Repeat this for every song you want to have in the list. You can also look in the Albums menu, highlight the album title and press-and-hold that to add the complete album to your On-The-Go Playlists with one press. So if you add the two albums to your On-The-Go Playlist, you can then listen to just those two albums.
    To shuffle the songs, turn on Shuffle on your iPod. Either, go into Settings/Shuffle and press the Select button to toggle between Off/Songs/Albums, or on the Now Playing screen, press the Select button three times to reach the Shuffle option, where you use the scroll wheel to move between Off/Songs/Albums, press the Select button to activate it.
    Having added songs to the On-The-Go Playlist, go into it and notice the list of songs and options to Save Playlist (New Playlist 1) or Clear Playlist. If you use Sync to manage your iPod (and that really is the best way by the way), the next Sync will transfer any unsaved On-The-Go and any New Playlist Xs that you have, back to your iTunes Library. You can even remove any song from the current On-The-Go Playlist by highlighting it (in the On-The-Go, obviously) and press-and-holding the Select button.
    If you need assistance in creating a Playlist in your iTunes Library, please ask.

Maybe you are looking for

  • IPOD Updater - Error 1324 - The Folder path contains an invalid character

    I tried to install ITUNES on an external HD (I didn't want to slow down my computer by putting all of my music on my internal HD). ITunes installed and then crashed. I removed all traces of ITUNES and IPOD that I could find and went to install ITUNES

  • Internal error in Salary Statement service

    Hi Someone can help with this issue. We are not able to get the payslip. In R3, we use a form created with PE51 and we have a variant for this. I already updated feature EDTIN with the variant name and HRFOR with $CEDT$ for C ESS. Following error is

  • Trying to download game and getting Spooge drivers not installed message

    The game is Dawn of War and everytime I try to download it I get that message, I am going through what hotfixes from microsoft I can for my graphics card but so far they aren't doing the trick. I don't know if this is the right forum for this or not

  • Space in tablespace

    Hi, Im using oracle 10g on RHEL 4, i have a tablespace with 100 datafiles, datafiles are distributed on diff mountpoints, all the mountpoints of the datafiles were almost full, after SAN migration SYSTEM administrator added sum space to old mountpoin

  • New audiobook not working

    Yesterday I downloaded an audiobook from the App Store using a gift card I received from Apple when I purchased my computer.  When I went to play it, I would hear the first second of the book and then it would stop playing.  I even tried resetting my