Looking for keys of print a diamond

ladies and gentlman:I'm new to java,When I doing my homework,there is a easy but hard-to-be-understand question really bothers me,so I come to looking for help.I will be appricatied your coming and answering.
Print a Diamond ----easy and old question!
here are my two keys,but i dont belive any of them is OOP,i mean,there is no object -oriented in the code and progamming,maybe just progressing.if there any brief key to the question or any explanation to a new java learner,I will really be thanks.
1st
public class LingXing{
     public static void main(String args[]){
          for (int i=0;i<=6;i++){
          for (int j=0;j<=6;j++){
               if (j>6-i)     
          System.out.print("*");
               else
          System.out.print(" ");
          for (int j=6-i;j<=6;j++){     
          System.out.print("*");
          System.out.println();
          for (int i=1;i<=6;i++){
          for (int j=1;j<=7;j++){
               if (j-1>i)     
          System.out.print("*");
               else
          System.out.print(" ");
          for (int j=i;j<=6;j++){     
          System.out.print("*");
          System.out.println();
2nd
public class Ling{
     public static void main(String args[]){
     for(int i=1;i<=7;i++){
          for(int j=1;j<=7;j++){
          if((i>7-j)&&(i>=j)){
                         System.out.print("*");
          else{
                         System.out.print(" ");          
     System.out.println();
     for(int i=1;i<=7;i++){
          for(int j=1;j<=7;j++){
          if((i<j)&&(8-i>j)){
                         System.out.print("*");
     else{
                         System.out.print(" ");                    
          System.out.println();
}

how about this????
this is object oriented approach......
public class Ling{
void alpha()
for(int i=1;i<=7;i++){
for(int j=1;j<=7;j++){
if((i>7-j)&&(i>=j)){
System.out.print("*");
else{
System.out.print(" ");
System.out.println();
for(int i=1;i<=7;i++){
for(int j=1;j<=7;j++){
if((i<j)&&(8-i>j)){
System.out.print("*");
else{
System.out.print(" ");
System.out.println();
public static void main(String as[])
Ling l = new Ling();
l.alpha();
}

Similar Messages

  • I can print from my macbook pro using airport express usb connected printer, however my iPad is looking for an airprint printer.  Can I direct the iPad to the usb connected printer.  Both macbook and iPad confirm a wifi connection through the airport exp.

    I can print from my macbook pro using airport express usb connected printer, however my iPad and iphone are looking for an airprint printer.  Can I direct the iPad/iphone to the usb connected printer.  Macbook iphone and iPad confirm a wifi connection through the airport express.

    You will need to install an App like Print Central on the iPad to try to print to the printer. It will allow you to print to most printers. Check with their support folks if you need more info.
    PrintCentral for iPad on the iTunes App Store

  • Looking for a Photo Printer

    Hello everyone. I am looking for a small printer that I can take with me to my photo session that can print glossy photos Something that can do the 8x10s or smaller.

    Hi again Kolourl3lind,
    Since you are looking for a compact photo printer, I recommend either the PIXMA iP100 or (maybe) the SELPHY CP900.  With the iP100, you will get better support for connecting the printer to a computer.  The CP900 is more suited for printing directly from a memory card or camera.  Both will produce excellent quality photo prints, but you are limited in size on the CP900 to around 4x6 prints.
    Of course, the PIXMA MG7120 is a good option as well.  This printer will allow you to print larger sizes and directly from a memory card.  However, it has some features you don't need (like scanning and copying) and it's definitely not as portable as the other two.
    My best suggestion is to contact our Sales Department.  Our agents will be happy to discuss the best model for your needs.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Looking for a Laser Printer which takes Paper Roll instead of seperate(A​4 size) papers

    we are looking for a Laser Printer which takes Paper Roll instead of seperate(A4 size) papers   

    I don't know of any laser printers that take a roll instead of sheets.  There are some small designjets that might have a roll feed accessory but they are inkjet printers and designed for graphics applications.
    insert signature here

  • I am looking for a multifunction printer, scanner, copier that is seriously easy to use for my very un tech savvy father. Must have AirPrint. Any suggestions?

    I am looking for a multifunction printer, scanner, copier that is seriously easy to use for my very un tech savvy father. Must have AirPrint. Any suggestions?

    I am looking for a multifunction printer, scanner, copier that is seriously easy to use for my very un tech savvy father. Must have AirPrint. Any suggestions?

  • Looking for a mobile printer for my car/ on the road work for my IPAD2

    Looking for a printer I can use in my car and where ever necessary.

    I've been happily printing for a while from my iPad to my battery-operated HP H470 with absolutely no wires (and no router / pre-existing WiFi connection - it operates in AdHoc mode). Literally just the iPad and the H470 - in fact, one time in a marquee in the middle of a muddy field with no power and a long way from the nearest WiFi connection, so it can be done from literally anywhere.
    Once I'd sorted it all out, I wrote down the solution and the steps to get it to work in the hope of helping others:
    http://genuinely-original.blogspot.com/search/label/iPad Printing
    Hope that's useful to someone!
    Thanks,
    Keith

  • HT4356 I checked everything out and had no problem printing from IPAD/MINI using the HP Photosmart 6520 printer, but the next day, using same application, my HP did not show, but was looking for the AirPrint Printer, what am I doing wrong?

    Using IPAD2, IPAD MINi, HP photosmartE6520 set up on wireless network.  No problem printing from my devices, but the following day, it is looking for AirPrint printer, why? 

    Hello lenc48,
    Welcome to the HP Forums.
    I see that you are having a few issues when it comes to printing from your mac as well as some two sided printing issues.
    I do have a some suggestions that we can try in the attempt to troubleshoot this issue.
    First off, please make sure that you have the printer power cable connected directly to a wall outlet and not a power bar/strip. Here is a document that uses a LaserJet printer as an example but it is meant for HP products in general. Please click on the following link that explains the Issues when Connected to an Uninterruptible Power Supply/Power Strip/Surge Protector.
    Please remove the usb cable (if using wireless, disregard this step) from the printer and from the Mac and leave it disconnected until further notice.
    Please click on the first link that will give you instructions on Uninstalling the Printer Software.
    Once the software has been removed, please disable any anti virus protection that you may have on the Mac. 
    The next step we are going to take is downloading the HP Photosmart 6520 e-All-in-One Printer Full Feature Software and Drivers - OS X 10.9 Mavericks.
    The installation will prompt you when to connect the usb cable (You will see a prompt for a wireless connection as well if that is the connection type you would like to use) so please do not connect the cable until prompted to do so.
    If you are still having issues, feel free to write me back or you can contact HP Total care direct.  If you are calling within North America, the number is 1-800-474-6836 and for all other regions, click here: click here.
    Thanks for your time.
    Cheers, 
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

  • Due to the requirement of a UUT report with pageheaders, I am looking for solution to print an MS Access report from TestStand. I am using TestStand 4.2 and LabView 8.6.

    Solved!
    Go to Solution.

    You can customize your process model with LabVIEW steps. You can connect to the access database http://digital.ni.com/public.nsf/allkb/1D5EB4DCBD13106486256B9D005E11B0 you can also get the data and format it and print it with the report generation toolkit, or you could see if Access exposes those functions through an ActiveX server. What functionality exactly are you looking for, and at the end of the day how much time are you willing to develop your own customized microsoft access reporting function?
    Richard S -- National Instruments --Applications Engineer -- Data Acquisition with TestStand

  • Looking for a MFC, printer/scanner

    I am looking for an all in one printer scanner. I need both the printer and the scanner to work in arch linux, and I don't want to spend a week making it happen. I would prefer something that supports ethernet and both features work over the network but that isn't absolutely necessary. After wasting 2 hours looking at printers then looking up their linux support I decided to ask you guys. What do you use that meets my requirements? would you recommend it to someone who hadn't just killed your cat?

    zenlord wrote:
    In our office we have been using a Brother MFC8860DN for three years now. We use Debian linux exclusively. Very good choice, thinking of buying the MFC8880DN to have a backup for when our first MF should start to lose its feathers... Last week I wrote my first bash script to use together with this device: I have it scan to ftp and our server performs OCR on the scan automatically.
    Brother has full linux support. They provide drivers in deb and rpm, but I guess it should not be a problem to get those packages working in arch linux.
    I'm quite surprised to see so many HP-fans out here, but probably their drivers are better for linux than they are for windows. The last HP Photosmart-printer had a driver that was 345MB big, and it could not be installed because the printer had been connected to the laptop *prior* to installing the driver. I had to reinstall windows just to get that printer (mostly) working... So no HP printers for me anymore
    I can confirm that the HP drivers for Windows suck big time. When I turned on my new printer, I first installed it on my laptop. I ran a pacman -S hplip, ran the software, detected my printer over wireless, and was ready within a minute or so. Then I installed the printer on my desktop archer. Same results: I was ready within a minute. Then I booted into Windows XP. I had to download some serious MBs, and when I executed the exe file, installation was aborted halfway, because Windows were not installed on C:. After long research, I found the cure, which was a joke. I had to mount my system drive (E:) as a network drive and perform the installation in there LOL. Anyways, after installation, my whole system was getting very jerky and unresponsive, and cpu usage was getting very high. Didn't bother any more, just uninstalled it completely. Not much of a problem, though, since I have to use Windows rarely for a couple of apps.
    Last edited by panosk (2009-08-27 11:34:02)

  • Looking for Canon i9900 print driver

    I am looking for a print driver for my Canon i9900 large format printer
    Canon support indicates no driver is available

    You will have to use the Gutenprint v5.2.10 driver package. That model is too old for Canon to provide a supporting driver.

  • OSX 10.4.11 Looking for a compatible printer

    I'm trying to find a compatible printer to work with my Mac Mini OSX 10.4.11
    Regards
    AESD

    Thanks Carolyn,
    I'm new to mac.  I just purchased a Macbook Pro and am switching from a windows desktop.  It's a big learning curve.  I have an Epson Workforce all in one printer and it is working fine with my new laptop.  It does have fax capability but I have no need for it.
    However, I find that the ink is very expensive.
    I am not a business, but I do quite a lot of printing, including photos.  I'm an artist.
    I am wanting to replace my color laserjet multifunctional printer that I bought in 2007.  There are no driver updates for it, so I have to search for a new printer.
    I think I will have to wait a while until a compatible laserjet comes on the market.  It seems I'm hitting my head against a brick wall!!!
    Thanks again for trying to help.

  • Looking for software to print photos

    I have Iphoto, but I want to print wallet size photos, any suggestions?

    I am pretty sure there is a setting for something very close to wallet size photos in iPhoto. Look carefully at printing multiples on a page. It may be in the Printer options once you say Print.

  • Looking for portable wireless printer for new iPad mini

    I am looking to purchase a portable printer for a new ipad mini.  I am on the road alot, and need a printer that I can plug into the car, hotel, airport, etc..  I looked at the Canon ip100, which  is portable, but does not support AirPrint, but it has bluetooth.  The printer looks nice, portable, even battery operated, but does not work with ipad.  Does anyone have any suggestions?  Thank you in advance.

    You maybe able to see if there is a Canon app that will allow you to print to the printer even though its not compatible.
    If not here is a list of compatible air print printers http://support.apple.com/kb/ht4356

  • Looking for help to print up sheet music of the songs and chords

    Hi everyone. This is my first post. I just got a new imac a few months ago. I am writing songs for garage band and would like to print them up with the chords, so basically home made sheet music. I am new to Macs and usually try this with a Microsoft word document but it moves the chords around so that they are out of sync with the lyrics. There must be a professional program or template I can use to do this either on a Mac or a pc. I would appreciate any help.

    I did a quick google and found some Windows-based programs you could buy to do that, but nothing for the Mac.
    However, you ought to be able to do it in word (I do when I have to print chords w/ lyrics to play with a group). You just have to fiddle with the space bar and tab to line up the chord changes with the lyrics.
    It might be easier if you use a fixed-width font like Courier.

  • Looking for a WiFi printer that will work with my Nexus WiFi hotspot

    On a recommendation, we have bought an Epson NX530 WiFi-enabled printer.  It does not work with the WiFi hotspot feature of my Galaxy Nexus.  The support tech at Epson suggested that we get a WiFi router rather than trying to use the Galaxy Nexus.  I told her that I would rather trash the NX530 and get a printer that would work with my phone.
    So we have 3 questions:
    1) does anyone know how to make an Epson NX530 work via the Galaxy Nexus hotspot?
    2) does anyone know of a different WiFi enabled printer that works with the Galaxy Nexus?
    3) does anyone know if the Galaxy Nexus is inherently unable to work with any WiFi printer?
    Thanks,
    Craig

    This website should be able to assist you.  http://www.galaxynexusforum.com/forum/galaxy-nexus-help/8520-wifi-printing.html   I use an app called Printhand from the Google Play Store for my Android tablet and smart phones. I have a Canon  Pixima 3220 that functions great. I also have a higher end HP Envy D410a that also works great with printhand.  The Canon is cheap at BJ's at $40 when I bought it. The HP is about $269 at Staples and other outlets.  Good Luck

Maybe you are looking for

  • HT1296 how can I sync my pdfs between  2 iphones ?

    hi, I am trying to sync my PDFs from one iphone to another. iCloud does not have a option for this (that I can see ) will iTunes do it ?

  • Save attachment on content server and create a document link

    Hi All I have the following requirement: 1. We have an attachment 2. We are creating a parked document number. 3. We need to place the attachment on the Content Server 4. We need to create a link b/w the parked document number and the attachment whic

  • Load Movie in Background?

    Hi, we're designing a portfolio site. It will have a fairly large amount of large bitmap images that need to look really good. I'll make another post to make sure I have the very best optimization techniques down. - But I'm wondering if/how to have a

  • Technical Master data replication CRM to ISU

    Dear Experts, This is regarding the replication of TECHNICAL MASTER data from CRM to ISU. I have done all the required setting and the data is replicating to ISU as well except PoD.Unable to replicate POd.Can any one suggest on this Also while creati

  • Logic for matrix

    Hi ABAP experts, I have a excel file which needs to be uploaded into a table. Ok, but to extract the right values, i need to set the matrix/coordinate for the value in the excel file as well : e.g file value: row 1, column 1 = Bob.. i need to upload: