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 8588081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:43:36+00:00 2026-06-11T22:43:36+00:00

As you can probably understand from the question itself, I’m new to Java. I

  • 0

As you can probably understand from the question itself, I’m new to Java.
I was given an exercise to write a Java program which receives a character, prints it and the next character in the Unicode table.

Now, I have the solution to this exercise:

public static void main(String[] args){
    char c = args[0].charAt(0);
    char c1 = (char)(c + 1);
    System.out.println(c + "\t" + c1);
}

I understand basic idea of this code, but I’m trying to run this code in Eclipse I get an annoying error:

Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 0
at MainClass.main(MainClass.java:9)

Note: I have yet to run a Java program that actually receives something as a parameter so I guess it’s a stupid beginners’ mistake… Here is the full code that I tried to compile in Eclipse:

public class MainClass {

    /**
     * @param args
     */

    public static void main(String[] args){
        char c = args[0].charAt(0);
        char c1 = (char)(c + 1);
        System.out.println(c + "\t" + c1);
    }
}

Thanks in advance

  • 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-11T22:43:37+00:00Added an answer on June 11, 2026 at 10:43 pm
    • Select “Run -> Run Configurations” from the menu.
    • Search for you project in the list on the left and select it.
    • Select the “Arguments” tab on the right.
    • Write the argument you want to pass to the programm in “Programm arguments”.
    • Click “Run”
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From the question you can probably tell that I don't know much about code!
I have one question but it can probably be answered by one of several
Probably I completely don't understand it, so can you take a look at code
My question is regarding i18n in Python. From what I understand, it involves: Create
This is a real beginner question (I'm still learning the Java basics). I can
Probably another dumb question that results from my studying in bad C++ book (I
Here goes my first question. First of all I'm new with Java and still
This is probably a very simple question, but I just can't figure it out.
I'm new to iPhone dev, so this probably seems like a really silly question,
somewhat related to: libxml2 from java yes, this question is rather long-winded - sorry.

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.