But on OCA exam I met some examples, and my response was wrong because I said: don't compile.
I will suggest to Java community to make reserved all the date types.
data type or date type? what are you referring to in this?
If you are considering "String" as a data type, any class can become data type. You can not make every class reserved word.
I guess that is why primitive data types are considered as reserved word.
Dana Ucaed wrote:So you can define a variable named Boolean, Byte, Integer, Long and the compiler don't say anything.
Yes. And you can create your own class named Cheese and then define a variable named Cheese. Should that be illegal too? Or should it only be illegal to use names of the (several thousand) classes in the standard API?
Here's the problem with that idea. With every new version of Java come a lot of new classes. So that could suddenly create a lot of new names which now are illegal to use as names of variables. This could make programs which used to be correct now not correct. And that would be a very bad thing. Oracle takes backwards compatibility (which means that releasing a new version of Java should not make existing code work differently) very seriously.
Reserved key words in Java usually start with small case. If you are using an IDE for practice you can easily observe the color change when your write normal class (User defined or Platform provided) and key words. Anything you write after writing a class will be considered as a variable of that type(the class which you write). The same holds good for primitive data types also(int, long, char, byte, etc.,.). Hence you can differentiate through smaller case and upper case
That's not true! During the Java course at school I used Notepad, javac and java to compile and run applications.
Dana Ucaed wrote:Do all IDE generate error compiler confusing?
Different IDEs might generate different compiler error messages.
Dana Ucaed wrote:There is a IDE that show us the same error compiler as javac?
Why not simply use javac & java and get rid of the IDE while preparing for the OCAJP exam? For me using an IDE during the preparation for the certification exam is definitely a don't. Why? Very easy: on the actual exam you also don't have an IDE (and compiler) to help you verify and run code. You are all on your own. So my first advice would definitely be: get rid of your IDE, only use your favourite text editor, javac and java. Other opinions about using an IDE while preparing for the OCA exam can be found here.