Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: CANT PRINT

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CANT PRINT

    Thread [main] (Suspended)
    PrintStream.println(String) line: 755
    Ex6.main(String[]) line: 35

    WHAT IT MEEANS?


    public class Ex6 {

    public static void main(String[] args) {

    Scanner scanner = new Scanner(System.in);
    int f = scanner.nextInt();
    int t = scanner.nextInt();
    int s = scanner.nextInt();
    int temp, temp1, temp2;
    int temp3 = s;
    int countSimilarVariables = 0;
    //int countVariablesOfS = 0;
    int countVariablesOfT = 0;
    boolean flag = false;

    if((f>0)&&(t>0)&&(s>0))
    {

    if(t>f)
    {
    temp=f;
    f=t;
    t=temp;
    }

    temp1 = f;
    temp2 = t;

    while(temp1>=t)
    {
    System.out.println("lala"); /// THE PROBLEM IS HERE


    --- Update ---

    i found that there was no problem in my code. the problem is when i debug the line of printing.
    why it happens?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: CANT PRINT

    How are you executing the program? Are you using an IDE that could interfere with the execution?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: CANT PRINT

    I use eclips

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: CANT PRINT

    Ok, I've moved this to the IDE section.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: CANT PRINT

    Are you in debug mode and have a breakpoint set on line 35?

  6. #6
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: CANT PRINT

    package pro4;

    import java.util.Scanner;

    public class Ex4 {

    public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = scanner.nextInt();
    int temp=num;

    if(num>0){
    for(int i=0;i<num;i++)
    {
    for(int j=0;j<temp;j++)
    {
    System.out.print((i+1)*(j+1) + " ");
    }
    System.out.print("\n");
    }
    }else
    {
    System.out.print("illegal input");
    }
    }
    }


    even for these simple code i cant debug when i get to System.out.print((i+1)*(j+1) + " "); line

Similar Threads

  1. Need to print the words
    By nimesh89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 26th, 2013, 05:27 AM
  2. Replies: 1
    Last Post: December 3rd, 2012, 02:35 PM
  3. xfa.host.print: print a page + some page range.
    By gammaman in forum Totally Off Topic
    Replies: 2
    Last Post: May 10th, 2012, 08:07 AM
  4. Help! Can't make it print right!
    By oracleman in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 5th, 2011, 03:12 PM
  5. Print out a JFrame
    By ellias2007 in forum AWT / Java Swing
    Replies: 8
    Last Post: June 17th, 2010, 06:15 AM