Unfortunately it doesn't work and I get : Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at EnterValuesFromKeyboard.main(Rectangle.java:14)
How can I fix it?
As a matter of semantics, your program is giving a runtime error which means it does compile.
The error implies you are calling it as "java Rectangle" instead of "java Rectangle 1 2". If this is not the case, can you show how you are running the program?
I use JCreator. When I run the program I can't supply any arguments (or I don't know how to do it). In build output I have: Process completed. but in General output I have Exception.
I myself have not used the JCreator IDE. But can you try the steps under Setting Up Command-Line Arguments topic in a JCreator tutorial link -> a JCreator tutorial and give 1 2 as arguments for the Main method as given in the picture?
Its similar to running java Rectangle 1 2 i think.
I would advise you not to use an IDE for now. At this point you're not familiar with the basics and using by using just a text-editor and a compiler you'll pick those basics up much faster.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.