Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8304173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:46:34+00:00 2026-06-08T17:46:34+00:00

Consider a java program with many variables and some of them are counters for

  • 0

Consider a java program with many variables and some of them are counters for loops I want to see the values of these variables as they change with time , WITHOUT putting print statements everywhere in my code.

Why ? I think it can help me to debug easily.

Example-
int a = 7;  
for(i=0; i<3; i++)
{
  a++;
}

As this program runs I want to get live reports like this:

t is 0, a is 7, i is 0
t is 3, a is 8, i is 1
t is 12, a is 9, i is 2
(t is time, time factor is NOT necessary though)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:46:36+00:00Added an answer on June 8, 2026 at 5:46 pm

    You should use a debugger and put a breakpoint where you want to see the values (in this case at the line with a++). The you can see the value at each iteration.

    Most IDEs have debuggers (Intellij IDEA, Eclipse or NetBeans).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem while doing some XSLT pre-processing in my java program.
I have a Java program aiming to consider an xml dom and write it
I'm reading this: http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.20.2 They say: Consider the example program: class Point { int
Consider these methods from java.lang.String /** * Returns the string representation of the <code>Object</code>
Consider this simple program. The program has two files: File Vehicle.java class Vehicle {
If yes, on which operating system, shell or whatever? Consider the following Java program
Consider a scenario that a java program imports the classes from jar files. If
Consider the following program: import java.util.List; import java.util.ArrayList; public class TypeTest { public static
Consider following situation: I write a java program for an embedded(modem) device. The SDK
Consider: import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.crypto.*; import javax.crypto.spec.*; import java.security.*; import

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.