Results 1 to 4 of 4
  1. #1
    cagipple is offline Member
    Join Date
    Mar 2011
    Posts
    11
    Rep Power
    0

    Default Why won't my print statements show up?

    None of my print statements are showing up in the output, except for the very last one. Anyone know why?


    Here is the code:


    // Chris Gipple Lab 4

    public class LAB4A {
    public static void main(String[] args) {
    onestep();
    }




    public static void onestep(){

    int jtot=5;


    for (int j=1; j==jtot; j++){

    for (int i=0; i < (jtot-j)*5; i++){
    System.out.print(" ");}

    System.out.print(" o ******");
    System.out.println();


    for (int i=0; i < (jtot-j)*5; i++){
    System.out.print(" ");}

    System.out.print(" /|\\ *");
    System.out.println();


    for (int i=0; i < (jtot-j)*5; i++){
    System.out.print(" ");}

    System.out.print(" / \\ *");
    System.out.println();

    }


    System.out.println("****************************** **");
    }

    }

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by cagipple View Post
    int jtot=5;

    for (int j=1; j==jtot; j++){
    1 != 5 so your for-loop body never executes.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    786
    Rep Power
    5

    Default

    Yes :

    Java Code:
    for (int j = 1; j == jtot; j++)
    loop while 1 == 5 --> never :)

    The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)

  4. #4
    cagipple is offline Member
    Join Date
    Mar 2011
    Posts
    11
    Rep Power
    0

Similar Threads

  1. Replies: 3
    Last Post: 05-27-2010, 10:54 AM
  2. Replies: 6
    Last Post: 11-12-2009, 10:50 AM
  3. Loop System print or println statements
    By Singing Boyo in forum New To Java
    Replies: 6
    Last Post: 03-22-2009, 03:52 AM
  4. Print the text file and print preview them
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-22-2008, 11:04 PM
  5. netbeans 6.0 not show commpunent or show blank page
    By fahimaamir in forum NetBeans
    Replies: 1
    Last Post: 01-26-2008, 06:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •