Keywords in Java
Keywords in Java
Java keywords को reserved words के नाम से भी जाना जाता है। इन शब्दों (words)(नामों) को Java में विशेष काम के लिए reserved किया गया है. इसलिए इस नामों के आप variables, methods, objects, class (कोई भी identifiers) नहीं बना सकते हैं.
Lists of Java Keywords
| abstract | assert | boolean | break |
| byte | case | catch | char |
| class | const | continue | default |
| do | double | else | enum |
| extends | final | finally | float |
| for | if | implements | import |
| instanceof | int | interface | long |
| native | new | null | package |
| private | protected | public | return |
| short | static | strictfp | super |
| switch | synchronized | this | throw |
| throws | transient | try | void |
| volatile | while | true | false |
abstract
इस keyword का उपयोग abstract classes और abstract methods बनाने के लिए होता है.
boolean
इस keyword का उपयोग boolean प्रकार के data type बनाने के लिए होता है.
break
इस keyword का उपयोग loop या switch statement को तोड़ने के लिए किया जाता है।
byte
इस keyword का उपयोग integer प्रकार के data type बनाने के लिए होता है.
case
इस keyword का उपयोग switch statement में text के blocks को चिह्नित करने के लिए किया जाता है।
catch
इस keyword का उपयोग try statement द्वारा उत्पन्न exceptions को catch (पकड़ने) करने के लिए किया जाता है।
char
इस keyword का उपयोग character प्रकार के data type बनाने के लिए होता है.
class
इस keyword का उपयोग class बनाने के लिए होता है.
default
इस keyword का उपयोग switch statements में default block बनाने के लिए किया जाता है।
do
इस keyword का उपयोग while keyword के साथ do - while loop बनाने के लिए किया जाता है.
double
इस keyword का उपयोग floating-point (दशमलव) प्रकार के data type बनाने के लिए होता है.
else
इस keyword का उपयोग if keyword के साथ if - else conditional statement बनाने के लिए किया जाता है.
extends
इस keyword का उपयोग यह दिखाने के लिए किया जाता है कि एक class दूसरे class या interface से लिया गया है।
final
इस keyword का उपयोग variables, methods और classes को final बनाने किया जाता है. final बनाया गया variable में constant मान होते हैं. final बनाया गया varaible, method या class को override नहीं किया जा सकता है.
finally
इस keyword का उपयोग try - catch keywords के साथ exceptions को handle करने के लिए किया जाता है. finally block हमेशा execute होता है, चाहे exceptions आए या ना आए.
float
इस keyword का उपयोग दशमलव प्रकार के data type बनाने के लिए होता है.
for
इस keyword को उपयोग for loop बनाने के लिए किया जाता है.
if
इस keyword का उपयोग if conditional statement बनाने के लिए किया जाता है.
implements
इस keyword का उपयोग interface लागू (implement) करने के लिए किया जाता है।
import
इस keyword का उपयोग package, class या interface को आयात (import) करने के लिए जाता है.
instanceof
इस keyword का उपयोग यह जाँचने के लिए किया जाता है कि एक object एक विशिष्ट class या एक interface का एक उदाहरण (instance) है.
int
इस keyword का उपयोग integer प्रकार के data type बनाने के लिए होता है.
interface
इस keyword का उपयोग interface class बनाने के लिए होता है. जिसमें केवल abstract methods होते हैं.
long
इस keyword का उपयोग integer प्रकार के data type बनाने के लिए होता है.
module
इस keyword का उपयोग module बनाने के लिए होता हैं.
new
इस keyword का उपयोग नया object बनाने के लिए किया जाता है.
null
इस keyword का उपयोग यह दिखाने के लिए किया जाता है कि एक reference कुछ भी refer नहीं कर रहा है।
package
इस keyword का उपयोग package बनाने के लिए किया जाता है.
private
यह keyword एक access specifier है. इसका उपयोग variables, methods और constructors को private बनाने के लिए किया जाता है.
protected
यह keyword एक access specifier है. इसका उपयोग variables, methods और constructors को protected बनाने के लिए किया जाता है.
public
यह keyword एक access specifier है. इसका उपयोग variables, methods और constructors को public बनाने के लिए किया जाता है.
requires
यह keyword एक module के अंदर आवश्यक libraries को उल्लेखित करता है.(Java 9).
return
जब method का execution पूरा हो जाता है, तो return keyword का उपयोग उस method से एक मान (value) को वापस करने के लिए उपयोग किया जा सकता है.
short
इस keyword का उपयोग integer प्रकार के data type बनाने के लिए होता है.
static
इस keyword का उपयोग variables और methods को static बनाने के लिए किया जाता है.
super
यह keyword एक reference variable है, इसका उपयोग parent class के object को संदर्भित करने के लिए किया जाता है।
switch
इस keyword का उपयोग switch statement में किया जाता है.
Synchronized
उल्लेखित करता है कि methods को एक समय में केवल एक ही thread द्वारा access किया जा सकता है.
this
इस keyword का इस्तेमाल किसी method या constructor में वर्तमान object को refer करने के लिए किया जा सकता है।
throw
इस keyword का उपयोग मुख्य रूप से स्वंय का (custom) exception बनाने के लिए उपयोग किया जाता है.
throws
यह keyword बताता है कि एक method द्वारा क्या - क्या exceptions throw (फेकें) किए जा सकते हैं
transient
इस keyword का उपयोग क्रमांकन (serialization) में किया जाता है.
try
इस keyword का उपयोग catch keyword के साथ try....catch statement में जाता है.
var
इस keyword का उपयोग variable बनाने के लिए किया जाता है। (Java 10).
void
इस keyword का उपयोग method के साथ किया जाता है. यह बताता है कि method का कोई return मान नहीं है.
volatile
इस keyword का उपयोग यह बताने के लिए किया जाता है कि एक variable अतुल्यकालिक (asynchronously) रूप से बदल सकता है.
while
इस keyword का उपयोग while loop में किया जाता है.
