What is magic word in java? and How to find it?

Ca fe ba be

steps:
when u open any .class file.u can see first 4 characters.u have read those characters from the class file and convert those characters into Hexadecimal using toHexString method in Integer wrapper class.

Showing Answers 1 - 3 of 3 Answers

Narasimha Rao Konjeti

  • Jul 6th, 2006
 

As I have understood Java in my last 7 years of experience, Magic Words are deprecated reserved (key) words.

Why do we call it as Magic Word is that reserved is no more in the language, but still compilers recognises it.


For example. 
If you take goto, const reserved words in Java, these two are no more, but compiler recognises, why because, VM should run the old code. That is, it is there with VM. So that soft of words are called "Magic Words".

Regards
-Narasimha Rao Konjeti.

  Was this answer useful?  Yes

nrkonjeti

  • Jul 6th, 2006
 

Sometimes the specification for a programming language will have reserved words that are intended for possible use in future versions. In Java, const and goto are reserved words ? they have no meaning in Java but they also cannot be used as identifiers. By "reserving" the terms, they can be implemented in future versions of Java without "breaking" older Java source code. Thanks & Regards -Narasimha Rao Konjeti

  Was this answer useful?  Yes

pankaj

  • Aug 16th, 2006
 

A reserved word, sometimes called a magic word is a word which, in some computer programming language  cannot be used as an identifier because it is already used for some grammatical purpose. For instance, in SQL a user cannot be called 'group' because the word 'group' is used to indicate that an identifier refers to a group, not a user. Such a word is a keyword it is because its use is restricted that it is also a reserved word.

Sometimes the specification for a programming language will have reserved words that are intended for possible use in future versions. In Java const and goto are reserved words ? they have no meaning in Java but they also cannot be used as identifiers. By "reserving" the terms, they can be implemented in future versions of Java without "breaking" older Java source code

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions