Quick question, could someone help

I'd like to know how to remove the last entry of a String type array, been havin' trouble with it, sorry for the dumb question.

Depending on what you're tring to achieve,
myArray[myArray.length - 1] = null;or
String[] newArray = new String[myArray.length - 1];
System.arrayCopy(myArray, 0, newArray, 0, newArray.length);
myArray = newArray;

Similar Messages

  • A serious question  ,could someone help me please just a little problem

    this is a program to let me open a file and read birthday and related name, and then type name we can fetch the birthday, everything is ok ,whenever i input a name, it always find nothing, can some experts help me please
    there are three class i defined, one is birth_reader, another is date to record the date have been read from specified file, one is the name stored firstname and last name, the file my lecture give me is just a simple txt file which is example like:
    1 31 1984 robin ralu
    i realised maybe i shoud add a equals() to test ,but how can i do that , i have really no idea
    please
    import java.util.Scanner.*;
    import java.util.*;
    import java.io.*;
    public class birth_reader
    public static void main(String[] args)throws IOException
    birth_reader haha=new birth_reader();
    Map <name,date> book=new HashMap<name,date>();
    Scanner input=new Scanner(System.in);
    name b;
    FileReader fin = new FileReader("birthday.txt");
    Scanner sc = new Scanner(fin);
    while(sc.hasNext())
    int cat=sc.nextInt();
    int cta=sc.nextInt();
    int atc=sc.nextInt();
    String first_name=sc.next();
    String last_name=sc.next();
    date a=new date(cat,cta,atc);
    b=new name(first_name,last_name);
    book.put(b,a);
    System.out.println(book);
    System.out.println("please enter the name");
    String f=input.next();
    String l=input.next();
    b.firstname=f;
    b.lastname=l;
    date p=book.get(b);
    if((p!=null))
    System.out.println(b+":"+p);
    else{ System.out.println("no person here"+" "+b);
    public class name
    String firstname,lastname;
    public name(String firstname,String lastname)
    this.firstname=firstname;
    this.lastname=lastname;
    public String toString()
    return firstname+" "+lastname;
    public class date
    int year,month,day;
    public date(int year,int month,int day)
    this.year=year;
    this.month=month;
    this.day=day;
    public String toString()
    return year+" "+month+" "+day;
    public int getyear()
    return year;
    public int getmonth()
    return month;
    public int getday()
    return day;
    }

    Why do you suppose you should add an equals method?
    In what class would you add it?
    How would that change the behaviour of your code?
    What else should you keep in mind when overriding equals?

  • Hi im having trouble with downloading an album off my computer. i have forgotten the security questions, but have already sent them to my email. could someone help me in how to get the answers?

    Hi im having trouble with downloading an album off my computer. i have forgotten the security questions, but have already sent them to my email. could someone help me in how to get the answers?

    Hello Carpets,
    Thanks for the question. You can reset your security questions with your rescue email address, as outlined with this article:
    Apple ID: All about Apple ID security questions
    http://support.apple.com/kb/HT5665
    If you do not see the option for resetting your questions with a rescue email address, see this excerpt:
    Note: The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need to contact iTunes Store support in order to do so.
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Additional Information:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Thanks,
    Matt M.

  • HT6058 well, could someone help me please, i want to update the software to be ios 7.0.4, my question is, if i did update will whats app conversation delete? thank you for help

    Dear sirs,
    Could someone help me please, my version is 5.1.1 i want to update the software to be ios 7.0.4, my question is, if i did update will whats app conversation be deleted? thank you for helping me
    <E-mail Edited by Host>

    If you areupdating your idevice nothing will be deleted the i know of. I have updated my iPhone 5 to the lastest IOS 7.0.4 and everthing that i had on my iPhone 5 is still there, Just got all the awesome IOS7 features,
    iPhone tech
    Robbieeeee.

  • I have a Mac OS X Snow Leopard.  For some unknown reason the Library application in Finder disappeared and I was using it only two days ago.  Please could someone help?  Thanks.

    I have a Mac OS X Snow Leopard.  For some unknown reason the Library application in Finder disappeared and I was using it only two days ago.  Please could someone help?  Thanks.

    Hi cb-anc!  Thank you for replying to my question.  The Library application has disappeared,not the library folder.  I went into the application a couple of days ago to trash some plist files and now the application has disappeared. I haven't upgraded to Lion but am still on now Leopard.

  • Could someone help me out? ActionScript

    import flash.display.MovieClip;
    var clip:clip01 = new clip01;
    var clip2:clip02 = new clip02;
    var clip3:clip03 = new clip03;
    var clip4:clip04 = new clip04;
    var clip5:clip05 = new clip05;
    var files:Array = [clip,clip2,clip3,clip4,clip5];
    function randomizeArray(array:Array):Array
        var newArray:Array = new Array();
        while (array.length > 0)
    newArray.push(array.splice(Math.floor(Math.random()*array.length), 1));
        return newArray;
    var RandomArray:Array = randomizeArray(files);
    trace(RandomArray[0]);
    trace(clip);
    var c:MovieClip = MovieClip(RandomArray[0]);
    addChild(clip); // it’s OK
    addChild(c); // I get the error msg bellow:
    Scene 1, Layer 'movies', Frame 1, Line 29              1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.
    Could someone help me out?
    I cannot add MovieClip on the stage from the array.

    I have done till this the following code bellow. I’d like movie clip on the
    stage to be playing one after another in a randomized order in a loop. I
    used a timer, but this solution is not good, because the movies are not
    playing till the end. I need an EventListener to listen the end of the clip.
    How this code could be modified to work well, could you give me a solution
    to this problem?
    import flash.display.MovieClip;
    var clip1:clip01 = new clip01  ;
    var clip2:clip02 = new clip02  ;
    var clip3:clip03 = new clip03  ;
    var clip4:clip04 = new clip04  ;
    var clip5:clip05 = new clip05  ;
    var files:Array = new Array();
    pushArray(clip1,clip2,clip3,clip4,clip5);
    function pushArray(c1,c2,c3,c4,c5:MovieClip){
                    files.push(c1);
                    files.push(c2);
                    files.push(c3);
                    files.push(c4);
                    files.push(c5);
    function randomizeArray(array:Array):Array
                    var newArray:Array = new Array();
                    while (array.length > 0)
                                    newArray.push(array.splice(Math.floor
                                    (Math.random()*array.length), 1)[0]);
                    return newArray;
    var RandomArray:Array = randomizeArray(files);
    var testTimer:Timer = new Timer(1000);
    testTimer.addEventListener(TimerEvent.TIMER,updateFile);
    testTimer.start();
    function updateFile(event:TimerEvent):void
                    if (RandomArray.length == 0)
                                    pushArray(clip1,clip2,clip3,clip4,clip5);
                                    RandomArray = randomizeArray(files);
                    trace('play file',RandomArray[0]);
                    RandomArray.shift();
    //RandomArray[0].addEventListener(Event.ENTER_FRAME, VideoFinished);
    function VideoFinished(e:Event):void {
         if (RandomArray[0].currentFrame==RandomArray[0].totalFrames) {
              trace("finished");
    //addChild(RandomArray[0]);

  • Hi could someone help me please ? Ive just bought the new ipad and want to put some movies on it. I have already converted some movies using handbrake and tried to transfer them to my ipad and it just wont work. ive tried drag and drop and everything

    Hi could someone help me please ? Ive just bought the new ipad and want to put some movies on it. I have already converted some movies using handbrake and tried to transfer them to my ipad and it just wont work. ive tried drag and drop and everything

    bluztoo wrote:
    Haven't really used any of them including VLC - actually use netflix on the ipad more than anything. I was able to drop an mp4 into imovie on my ipad and see it there. This was something I had shot as avhcd and converted with turbo.264. Played fine. Probably not what you want for a movie player though.
    Well, turbo.264 is indeed very nice to have - even for converting full-sized movies. (Nevertheless, TechRadar's latest roundup (see http://www.techradar.com/news/software/applications/6-of-the-best-video-converte rs-for-mac-1074303 ; also linked from another roundup at http://www.iphonelife.com/blog/87/benchmark-excellent-multimedia-converter-handb rake-vs-commercial-apps ) has shown it's still worse than HandBrake in most respects.)
    All H.264 files (assuming they are H.264 level 4.1 or lower) are compatible with the built-in Videos app.
    bluztoo wrote:
    Those of you who use other players, what do you reccomend? Just curious.
    It entirely depends on your needs. The top players (AVPlayerHD / ProPlayer, It's Playing, GoodPlayer) all have different strengths and weaknesses. I myself use It's Playing the most as I convert everything into MP4 and simply love the DSP's (brightness / volume / saturation boosting). (Its software decoders are definitely worse than those of AVPlayerHD / ProPlayer; however, MP4's are played back from hardware.)

  • I purchased a digital itunes giftcard through paypal but can't seem to find a 'code' to use to redeem the card. Could someone help me find where that code would be found? I can see the paypal transaction details.

    I purchased a digital itunes giftcard through paypal but can't seem to find a 'code' to use to redeem the card. Could someone help me find where that code would be found? I can see the paypal transaction details. jgm22

    -> iTunes Cards & Codes

  • I have  Mac os x 106. When I try to send an attachment with email it won't send.  Please could someone help? Thank you.

    I have a Mac OS X 10.6 When I try to send an attachment with email it won't send - keeps saying 'fail'.  Please could someone help? Thank you.

    Hi lllaass! I replied to your post with the information you required but haven't heard from you since. If you don't, or can't help any further please would you let me know. Thanks.

  • Hello! I have some my violin recorded audio files and want them to be converted to printable notation throw "audio to score"from Factory. But do not have a normal result. Could someone help me, please. .

    I have some my violin recorded audio files and want them to be converted to printable notation throw "audio to score"from Factory. But do not have a normal result. Could someone help me, please. .

    seeren wrote:
    Normal result is on the sloppy side of inaccurate.
    Wish I'd started this topic so I could give you a green star!
    Great description.

  • I had to forcequit pages and now it won't reopen. Could someone help?

    I had to forcequit pages and now it won't reopen. Could someone help?

    It sure helps if you give more details.
    You do know we can't see your screen?
    Is it on Mac or iGadget?
    What version of Pages, on what version of OSX?
    What exactly happened?
    What messages if any have you got when it quit and when you try to relaunch it?
    Have you tried starting Pages holding down the shift key so it doesn't try to reopen any damaged files?
    Peter

  • HT5557 I have bookmarks and notes that are no longer attached to the original page and I can't find a way to delete them.  Could someone help me purge these things so they are not in the way?

    I have bookmarks and notes that are no longer attached to the original page and I can't find a way to delete them.  Could someone help me purge these things so they are not in the way?

    James Ward4  Thanks for your suggestion.  I have tried the video app and it appears to have some, but not all of the downloads which are viewable without wifi, so I will now review the download process and see if I can capture the missing episodes.  Thanks again.

  • Could someone help me restore my photos?  I was trying to "restore my database" in iPhoto when it shut down - now my thumbnails are distorted, logged under a new name, and when you click on a thumbnail it opens as another photo.  I was following another "

    Could someone help me restore my photos?  I was trying to "restore my database" in iPhoto when it shut down - now my thumbnails are distorted, logged under a new name, and when you click on a thumbnail it opens as another photo.  I was following another "helpful hint" hold down the option and command key and restart iPhoto - select the top three and you should be able to get rid of the dreaded exclamation point.  My MAC ran through the first two options dealing with thumbnails, but crashed during the "restore database"  step and now I have a mess.  Help, please.  Thank you.

    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  

  • Windows 7 very slowed after I downloaded ITunes. could someone help me?

    My PC with Windows 7 is very slowed since I downloaded iTunes. Could someone help me? Thank you

    All purchases from the iTunes Store including free and paid apps are included in your purchase history which cannot be deleted. Deleting an app from your iTunes library on your computer or on your iPad or iOS device does not remove the app from your purchase history.
    You did use iTunes to download the apps or they wouldn't be incldued in your iTunes Store purchase history.

  • About numbering and section options... I need section numbers (1.1,1.2,1.3) that will automatically update as I remove ort add a page. Seams complicated. Could someone HELP me? Thanks

    About numbering and section options... I need section numbers (1.1,1.2,1.3) that will automatically update as I remove ort add a page. Seams complicated. Could someone HELP me? Thanks

    INDESIGN
    I finally found it. Took me couple of hours. It is OK now
    2014-11-18 11:05 GMT-05:00 kglad <[email protected]>:
        About numbering and section options... I need section numbers
    (1.1,1.2,1.3) that will automatically update as I remove ort add a page.
    Seams complicated. Could someone HELP me? Thanks  created by kglad
    <https://forums.adobe.com/people/kglad> in Adobe Creative Cloud - View
    the full discussion <https://forums.adobe.com/message/6940603#6940603>

Maybe you are looking for