Input & output
Intricacies of file operations made easy with JDoodle
Your programs will usually need to accept input and output (I/O) from users or external data sources in order to be useful. This document explains how to add inputs to your program and see the outputs using the various I/O modes available in JDoodle, such as STDIN, Input Args, and Interactive Mode, plus handling file input & output and API calls to external services.
Setting inputs
Here are three ways in which you can set inputs:
STDIN
Using STDIN, you can type the input in the area before pressing execute. This is useful if you’re trying out some test cases for your program or if you want to provide user input without waiting for your code to compile or run and without requiring multiple steps of user input.
Interactive Mode
This allows you to provide user input data to your program while it’s running. This is similar to running a program that accepts user input on your local machine. Instead of entering input through the terminal, use the interface to input data directly, simulating how the program behaves when it receives input during execution.
Input Args
When your methods or functions require command line arguments that are typically passed through the terminalcommand line at runtime, you can use Input Args to set those arguments.
Calling APIs
You can use JDoodle to call APIs, sending and receiving data from external services. Internet access required to call APIs is available to Pro plan users and above.
Adding external libraries
You can add external libraries for 20+ languages. To use them, you just need to add a public link to the library. If you need to install a software library or package, see Installing Libraries.
Upload input files
You can also upload your inputs to the code using ”Upload input files.” Read about file handling here.
Viewing output
The Input/Output tab allows you to view your programs’ output. You can also move the tab around, increase its size, or maximize it as needed. You can see the output in the browser in HTML/CSS IDE and frontend frameworks like React, Vue, Flask, etc. For React and languages supporting hot reload, code changes will be reflected in real-time in the browser without the need to press execute whenever you make modifications. For databases like MySQL, you can see query outputs on the console.
Support and resources
Is your issue still not resolved? Here are a few things you can do:
- Contact us by filling out this form.
- Read FAQs on JDoodle’s IDE.
- Drop your question in our JDoodle community.