Cookie Preferences

We use cookies to enhance your experience. Choose your preference for cookie usage.

Essential cookies are required for basic functionality. Additional cookies help us improve our service and provide analytics.

View third-party services
  • Google Analytics: Website traffic analysis and conversion tracking
  • RudderStack: Analysis of user interactions with the website
  • Microsoft Clarity: User behavior analysis & session recordings
  • Facebook Pixel: Marketing analysis of user activity

Convert to bytes

Report a typo

Read an input text from the console and print it as a sequence of bytes.

Use System.in as input stream directly. Avoid using Scanner.

Sample Input 1:

abc

Sample Output 1:

979899

Sample Input 2:

another text

Sample Output 2:

9711011111610410111432116101120116
Write a program in Java 17
import java.io.InputStream;

class Main {
public static void main(String[] args) throws Exception {
InputStream inputStream = System.in;
}
}
___

Create a free account to access the full topic