Print out some numbers

Hello:
At the movement I got array nums[]={"1", "2", "3", "4", "5", "6", "7", "8"},
Please tell me how to print out some numbers from the array by using for loop, and the result exactly like System.out.println( " 1 2 3 4 "); System.out.println(" 5 6 7 8);
Please run my codeing first, I'd like the result exactly same as my coding showing.
Thanks
import java.awt.*;
public class Test{
private static Test t;
private static String nums[]={"1", "2", "3", "4", "5", "6", "7","8"};
public static void main(String [] args){
     t=new Test();
private Test(){
     print();
private void print(){
     System.out.println(" 1 2 3 4 ");
     System.out.println(" 5 6 7 8 ");
}

Ugh!
I didn't see that you wanted 1,2,3,4 and 5,6,7,8 on new lines. This will do the trick. It's ugly but it works.
public class Test
    private static Test t;
    private static String nums[] = {"1", "2", "3", "4", "5", "6", "7", "8"};
    public static void main( String[] args )
        new Test();
    private Test()
        print();
    private void print()
        for (int i = 0; i < nums.length; i++) {
            if (i == 4) {
                // Print a Blank Line
                System.out.println("");
            String num = nums;
System.out.print(num + " ");
cheers,
Greg

Similar Messages

  • Question on printing out repetive numbers/letters in toString()

    i was doing my lab and this one was one of the labs we skipped but im still curious as to how to do it. it was basically about printing out any primative type in the toString but canceling out repetitive letters/numbers.
    ex: String c = "cccccccfebq";
    then the print out when i call toString will only be febq. any suggestions as to how i can do this.
    thanks in advance!

    http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/package-summary.html
    Regular expressions...I can't think of a good way to describe what they do....
    It's a way you can manipulate strings (for searching or replacing) using rules which can be simple or complicated or somewhere in between. The rules are like a little language of their own. In particular a grammar is defined in which sequences of characters can be thought of as generated by these rules and so the searching and replacing is done with respect to how the generated sequences compare against the input string.
    God that's a lousy description. I'll bet jschell or UlrikaJ can do better.
    In the meantime read the docs. There may be a tutorial online but I'm too lazy to search for it for you.
    BTW I got that ("aaaaaaaaaaaaWXYZ") from your first example. The question is what happens if there are non-sequential repetitions.

  • I have been trying to print out some document papers and nothing happens

    I had to get some papers for my home to be modified,the papers were documents and it said adobe reader,each time i try and print them out nothing happens ,what am i doing wrong

    Hi,
    Kindly let me know steps you follow to Print the PDf opening in Adobe Reader.
    ~PRanav

  • Why Does iPhoto 08 Crop Print Outs ???

    Hi. I would appreciate a little help here.
    I am trying to print out some 8" x 10" photos with borders, in landscape paper orientation, using an Intel Dual Core iMac, Mac OS 10.4.11, iPhoto 08 ver 7.1.2, approved HP Printer and HP Driver, on 8 1/2" x 11" HP Premium Photo Paper, at maximum dpi.
    File resolutions are generally:
    1600 x 1200 (2 Mega Pixels, 4:3 image aspect ratio, 395 KB file size),
    2048 x 1536 (3 Mega Pixels, 4:3 image aspect ratio, 790 KB file size),
    2560 x 1920 (5 Mega Pixels, 4:3 image aspect ratio, 2.2 MB file size), and
    3264 x 2448 (8 Mega Pixels, 4:3 image aspect ratio, 3.6 MB file size).
    The problem I'm having is that iPhoto prints the photo by cropping approx 1/4" off the left side and 1/2" off the right side of the screen image without indicating there will be any loss of image content. The screen image DOES NOT accurately reflect the printed image.
    Like most people that take pictures, I frame the shots the way I wanted the picture to look. In a picture of a family reunion the person on the far left would have half his head and body chopped off (missing) while the person on the far right would be totally cut out (missing). What I see on the screen IS NOT what I get when printed out. And of course, it does this consistently without warning. Why?
    I would accept uneven borders, but want the entire picture to print. Something I would have thought to be the default settings for iPhoto when printing "with borders." Foolish me.
    I understand some cropping might have to take place when printing "border-less" printouts, but not for those "with borders." There out to be a law against doing this without conscent.
    HP PhotoSmart will do this for me, but it's rather a hassle to have to transfer pictures over each time I want a satisfactory print out.
    How do I get my pictures in iPhoto 08 to print out "entirely?" Dare I say "normally?"
    Have tried many settings changes in iPhoto and Preview to no avail.
    Please help.

    Hi LarryNH,
    Thanks for your timely reply.
    Ok, let's do the math. What the heck?
    Pick out a photo in your iPhoto library that you can view and print out in Landscape View.
    Preferably a photo that you can instantly recognize the border changes in, or with rulers or grid lines. If possible, let's make it an image with a 4:3 ratio too.
    Chances are you will be able to see the entire photo on your screen — even though your screen mostly likely is not one with a 4:3 image aspect ratio (pixel Width divided by pixel Height). Hmmmmmm.
    Now print out the photo using iPhoto 08, letter paper size with borders. (Save yourself some ink by choosing the lowest dpi or fast printing)
    For me, actual image size was 10 1/16 "W by 8 1/4 "H. The letter paper size print out has a 5/16 " border on the left and a 5/8 " border on the right (not centered, even though it's supposed to be). Both top and botton borders measure 1/8 " (centered, like its supposed to be).
    Notice any chopping off of the image on the left and right sides when compared to the screen image? Hmmmmm.
    When I print the same photo using HP PhotoSmart
    For me, the actual image size is somewhat smaller: 9 13/16 "W by 8 3/8 "H. The letter paper size print out has a 9/16 " border on the left and a 10/16 " border on the right (approximately centered). The top border is 1/2 " and the botton border ise 9/16 " (again, approximately centered). BUT MOST IMPORTANT, the image of the photo I see on the screen is "entirely" present on the print out.
    The original photo has a 4:3 (or 1.3333) image ratio (4 divided by 3).
    Apple is printing out an incomplete horizontally uncentered image with a 1.2197 ratio (10 1/16 "W divided 8 1/4 "H).
    HP PhotoSmart is printing out a complete image with a 1.1716 ratio (9 13/16 "W divided by 8 3/8 "H), but at least it is a complete image and it is approximately centered.
    Besides Larry, I bought a Mac. I shouldn't have to do the physics and math. Apple should be, thus making life easier for you and me. I hope they're listening.
    I have been totally unable to coax a complete image out of iPhoto, let alone one properly centered.
    I have been trying to print photos from Events. I'm going to try one from Albums next.
    If you find a work around in iPhoto, please let me know. With borders it is do-able, as HP PhotoSmart has proven. I just wish iPhoto could do the same.
    Got-A-Question

  • How do I print out a text conversation?

    I need to print out some texts that my ex-boyfriend sent me to use as evidence.  Any ideas for how to print out the messages that are saved in my phone?

    Try the computer apps PhoneView (Mac) or TouchCopy (Mac & PC):
    http://www.ecamm.com/mac/phoneview/
    http://www.wideanglesoftware.com/touchcopy/index.php

  • When I print out photo thru iPhoto, the result is too dark.

    Hi all,
    I have a problem with printing a photo via iPhoto recently.
    I remember when I used iPhoto 9 to print out some of my photos but at that moment the result was pretty OK to me.
    However, I don't know exatly when but I guess it could be since I upgraded to iPhoto 10...
    Everytime I tried to print out some of my photos from my iPhoto library, the result is way too dark than its original color.
    I am using HP Photosmart device(C410ㅁ) with fuji photo papers.
    I tried to change several options like color sync or printing quality but NO use!!
    Strange thing is that if I use airprint with my iPhone or iPad, color level seems to be OK.
    But again, iPhone airprint doesn't give any options to manage printing quality level, it couldn't mitigate my problem, either.
    Is there anyone out there who has the same or similar problem just like me?
    Please share your knowledge to solve this issues.
    Thanks in advance
    Luke.

    What is the color profile of the photo?
    LN

  • Print priview and print out not matching

    I have a developed a script for Goods receipt.
    In the Print Priveiw in MB90  all the boxes inserted by me are appearing
    but in the print out some of this boxes are not appearing .
    Please help its a bit urgent.

    Hi
    wat you are seeing in the print preview is just the place where the boxes are displayed but unless you specify the intensity or the thicknessof the lines for the box they will not appear in the print.
    try giving some intesity as 10.
    Regards
    Zarina

  • Locket photos, How to print out tiny pictures

    I need to print out some photos for a small locket. The oval size of the locket is about .25" wide and slightly longer. How can use iPhoto or other Mac software to print out something that small?

    crop the photo to the ratio you want (like 25x28 - [or what ever slightly longer is]) - select the photo and print setting the print size and print
    LN

  • How to print batch numbers on the AR invoice print out

    Hi Gurus;
    Here is my question; I need to be able to print batch numbers on the print out of AR invoices, I used variable 492 in PLD and I am able to see the batch numbers directly linked with the AR invoice, meaning that I wont be able to see batch numbers that I entered on the Delivery even is the delivery doc was copy to the AR invoice.
    Is there anyway that I can see the batch numbers on the AR invoice print if I entered the batch number on the delivery and then copied that delivery to an invoice??
    My client wants to be able to send their customers and invoice with a batch number but he always follow the process from sales order to delivery and delivery to AR invoice and what this means is that he always entered the batch numbers on the delivery documents.
    Please help me!!!
    Thanks
    Jenny

    If the ad hoc printer mode is not available for the envy, there are some reasonably cheap ways to get a wifi network in your car.   A cheap router from best but will generate the wifi network.  Does not matter if you have Internet or not.  A ifi device will also work, and most/ all of them run on batteries.  Lastly, if you have a smart phone or I phone that generates a wifi hotspot, that may be enough to support the printing function.  ( I need to test my I phone later today to see if that works.)

  • Outline Print out for bullets & numbering

    Hi,
    In RoboHelp my default bullets have a left margin of say "0",
    but when I generate the print version they have a margin of say
    "1". It looks like this:
    1. xyz
    * xyz
    SSL Print out
    1. xyz
    * xyz
    Any ideas for a permanent fix?

    For anyone else the answer is:
    The margin settings for the numbered list can be tweaked by
    editiing the Lists style in RH (Format > Styles > Lists >
    Modify > Format > Paragraph >Indentation).
    If you don't see "Lists" as a style, make sure the box (Hide
    Inherited Styles), below the available styles is not checked, then
    it should show up.

  • In Numbers '09, version 2.3 (554), how to I get spreadsheet gridlines to print out? I have a Macbook Pro and use OSX 10.9.4 Mavericks.

    In Numbers '09, version 2.3 (554), how to I get spreadsheet gridlines to print out? I have a Macbook Pro and use OSX 10.9.4 Mavericks.

    HP,
    In Numbers '09, the only lines that print are Cell Borders. Apply borders and test by Printing to PDF.
    Jerry

  • How Do You Print Out A List Of Skype To Go Numbers ?

    When I attempt to print out a list of my Skype To Go numbers only the left hand column prints.  This is the column that contains the name and actual phone number.  The right column that contains the Skye To Go Number does not print.  How do I print both columns?Thank you, Melissa

    Hello, Melissa, and welcome to the Skype Community!
    Did you use the link from the page where you can see all the numbers?If you did and it still didn't come out exactly the way you wanted it, try it again with a different browser or with javascript enabled. For me, it printed what needed to be printed without an issue.
    If you're still having issues, please respond here and we'll see what else can be done.
    For your reference, this is how mine came out:
    Click to Enlarge

  • I am trying to print out information on a Google Maps page. I have the print setting on fit to width but the page does not print that way and some of the page that would normally show on page 2 is missing.

    The page prints out fine on Internet Explorer, but not on Firefox. 2 pages are supposed to print out but only 1 prints. Also it does not fit to width even though that's the setting.

    That file could be set as a Launch Agent or Daemon in your ~/Library or /Library, You could try to look for it or Safeboot your computer and then empty the trash. Safebooting disables Launch Agents/Daemon and Third Party Kernal extensions. Here's the article to Safeboot OS X: What is Safe Boot, Safe Mode? - Apple Support

  • Print View in Numbers 3.0

    I Need to see the print view in numbers 3.0. No longer an option under "view" tab. Also the page view I'm given does not align with the preview page when actually go to print - they look different and neither has transfered my document the same from previous numbers document.

    Thats it I have spent alot of time trying to re format my reports from the older version of numbers to the new, I thought for a little while I could live without the page view as i spent alot of time lining up the gold lines as page breaks but now I for some reason cant find the photos I want to use they are only listed by their date and when used in the spreadsheet, they are not where they should be when printing, Im sorry for using this forum for venting but I am absolutely P.....ed off the amount of time I have spent for nothing.  I have really apple and speak very highly of them, and I just cant believe they could update a programme like this, did they even test it before they put out there.  What the F is going on. sorry but Im NOT HAPPY, I think I will now go back to excell definately.

  • I just updated my OS to Mavericks, as well as my Pages app. Now my previously created documents print out as blank paper, even tho I can see the text on my desktop.The margins have also been altered. How do I fix this?

    I just updated to Mavericks, then updated my Pages App. Now none of my previously created documents print out, except as blank pages, even though I can see the text on the documents, but with altered margins, on my computer screen. How do I fix this so the documents print out normally again?

    Purplehiddledog wrote:
    I do backup with iCloud.  I can't wait until the new iMac is available so that I can once again have my files in more than 1 location without needing to rely solely on the cloud. 
    I also rely on iTunes and my MacBook and Time Machine as well as backing up to iCloud. I know many users know have gone totally PC free, but I chose to use iCloud merely as my third backup.
    I assume that the restore would result in my ability to open Pages and Numbers and fix the problem with deleting apps, but this would also mean that if my Numbers documents still exist solely within the app and are just not on iCloud for some reason that they would be gone forever.  Is that right?
    In a word, yes. In a little more detail.... When you restore from an iCloud backup, you must erase the device and start all over again. There is no other way to access the backup in iCloud without erasing the device. Consequently, you are starting all over again. Therefore, it would also be my assumption that Pages and Numbers will work again and that the deleting apps issues would be fixed as well.
    If the documents are not in the backup, and you do not have a backup elsewhere, the documents could be gone forever.

Maybe you are looking for

  • HP OfficeJet J6410 won't install under Windows 8

    Hello to you all, Two days ago, I bought a new notebook for my daughter. She needs it for her study. It's the HP Pavilion TouchSmart 11-e000ed. Again, just like the situation I wrote about before in this topic over here (link: http://h30434.www3.hp.c

  • Ipod classic hard drive coming back saying error after a diagnostics test

    i recently done my disk check on my ipod classic hard drive and it flashed up error instead of the numbers people normally get when doing this. does this mean the hard drive is finished. it was letting me sync 200 songs out of 9000 i have but no more

  • Cannot open old iPhoto library after updating from Tiger to Lion

    I changed my Mac and now I am using Lion on MacBook Pro. I am trying to open the iPhoto library that I used to have on my old PowerBook G4 with Tiger, but it does not work. When I open the library, iPhoto says that the library needs to be updated and

  • Model in Background callable object

    Hi Gurus, Currently we have an application where a Scheduled background callable object is used , that does some table updation to SAP R/3 backend. Now all the connection parameters are maintained in property files and JCO connection is created throu

  • Audiobooks play in random order

    Hi, I am having an issue (it's quite common, according to Google), where audiobooks appear to play in random order om the iPhone, while playing fine in iTunes. I could not find any fix or workaround on the net, so I'm wondering if anybody here knows