GeekInterview.com
Series: Subject: Topic:
Question: 75 of 124

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.
Asked by: Interview Candidate | Asked on: Jul 4th, 2006
Showing Answers 1 - 3 of 3 Answers
Narasimha Rao Konjeti

Answered On : 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.

  
Login to rate this answer.
nrkonjeti

Answered On : 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

  
Login to rate this answer.
pankaj

Answered On : 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

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Question Categories

Core Java Interview Questions

EJB Interview Questions

Hibernate Interview Questions

Java Interview Questions

Java Patterns Interview Questions

JDBC Interview Questions

JMS Interview Questions

JSP Interview Questions

Java OOPS Interview Questions

Ruby Interview Questions

Servlets Interview Questions

Spring Interview Questions

Struts Interview Questions

Websphere Interview Questions

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.