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

  • Home
  • SEARCH
  • 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 8994307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:24:04+00:00 2026-06-15T23:24:04+00:00

I googled it a lot and found nothing! Could someone help me with filling

  • 0

I googled it a lot and found nothing!
Could someone help me with filling an array of characters from user input, please?

  • 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-15T23:24:05+00:00Added an answer on June 15, 2026 at 11:24 pm

    I googled it a lot and found nothing! Could someone help me with
    filling an array of characters from user input, please?

    My Google said, try this one..

    Option 1 :

        import java.io.*;
       class array {
    
        public static void main(String args[]) throws IOException {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String tmp = br.readLine();
            int length = tmp.length();
            char c[] = new char[length];
            tmp.getChars(0, length, c, 0);
            CharArrayReader input1 = new CharArrayReader(c);
            int i;
            System.out.print("input1 is:");
            while ((i = input1.read()) != -1) {
                System.out.print((char) i);
            }
    
        }
    }
    

    Option 2:

    class array
    {
        public static void main(String args[])
        {
            Scanner sc=new Scanner(System.in);
            System.out.println("Please enter elements...");
            char[] a=sc.next().toCharArray();
            System.out.println("Array elements are : ");
            for (int i=0;i<a.length;i++)
                System.out.println(a[i]);
        }
    }
    

    But, in this case, it won’t accept after space character.

    Before, start your coding in Java, you must know these terms :

    BufferedReader

    Exception handling

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

Sidebar

Related Questions

I have googled a lot about this but found nothing useful. This has been
ok I'v googled a lot and found nothing that helps I have a set
i googled a lot and found out some info about the band object from
I've googled a lot. Found a lot as well. Unfortunately nothing is straight, easy
I have Googled a lot and found a lot of solutions, but none of
I have googled a lot on this and i have found integrations of Linkedin
I will prevent a window from iTunes to be opened. I googled a lot
I googled a lot on this but I still haven't found what I'm looking
After doing lot of research in Google, I found this program: #include <stdio.h> int
I've googled a lot but it seems to be rather difficult to find complete

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.