Java Programming - Language Fundamentals - Discussion

Discussion Forum : Language Fundamentals - General Questions (Q.No. 4)
4.
Which is a reserved word in the Java programming language?
method
native
subclasses
reference
array
Answer: Option
Explanation:

The word "native" is a valid keyword, used to modify a method declaration.

Option A, D and E are not keywords. Option C is wrong because the keyword for subclassing in Java is extends, not 'subclasses'.

Discussion:
25 comments Page 1 of 3.

Jaswanth Nelam said:   3 years ago
@Rushikesh.

No, it's not a return type, it is a keyword.

Manupriya said:   6 years ago
Thanks for the answer @Naresh.

Rushikesh said:   6 years ago
native is the return type of method or function.

Mahendra said:   7 years ago
Thank you friends.

Hitesh said:   7 years ago
Thanks @Naresh.

Shubham said:   7 years ago
Thanks @Naresh.

Naresh Reddy said:   7 years ago
'native' is a reserved keyword in Java. It is used to modify the methods and implementation of code can be done in other languages (c, c++).

Where to use this 'native' keyword?

When You need to call a library from Java that is written in other languages. Because while developing any application (or) something.

In such cases Java may not support your needs, then we can write code in other language and add it to the Java library.

Now we can access that library by using 'native' keyword. (ie. JNI) Java native interface.

I hope that this will make you understand a till bit better.
(7)

Priya said:   7 years ago
What is the use of native keyword?

Why we use native?
(1)

M.Samuel said:   8 years ago
Excellent explanation, Thank you.
(1)

Vishnu said:   8 years ago
In which way, 'native' is a reserved word in Java?


Post your comments here:

Your comments will be displayed after verification.