Identifier In Java Rules For Java Identifiers In Hindi
java में किसी भी नाम को identifier कहा जाता है .वह class name , variable name ,method name and label name हो सकता है .
example-
class Test {
public static void main (String[]args){
int x=10;
}
}
ऊपर के program में Test,main,String,args and x को identifier कहा जाता है .
Java identifier को Define करने के Rules
Rule-1
java में allowed characters - a to z, A to Z ,0 to 9 , _(underscore),$(dollar)
Rule-2
यदि आप उसके अलाबा और कुछ use किया तो आपको compile time error देखायेगा .
total_number----------------- valid
total#---------------------------Invalid
Rule-3
identifiers कभी भी number से starts नही होते हैं .
right123----------valid
123right----------invalid
Rule-4
java identifiers are case sensitive.मतलब आप java में UPPERCASE and LOWERCASE LETTER एक साथ use कर सकते हो जैसे-
class Test{
int number=10;
int Number=20;
int NumBer=30;
}
Rule-5
java identifier कुछ भी length limit नही होता है .लिकिन 15 से ज्यादा length recommended नही है .
Rule-6
identifiers में आप reserved word use नही कर सकते हैं .
int if=10; ---------invalid
Rule-7
लिकिन आप predefined java class name and interface class को आप identifiers की तरह use कर सकते हैं int String=10;
int Runnable=10;
आपको कुछ भी problem ही java से जुडी जानकारी से तो आप हमें comment section में comment कर सकते हैं .में अभी एक software developer हूँ मुझे पता है आपको कैसा पढना है .यह था आज का टॉपिक reserved keywords के बारे में .उम्मीद करता हूँ आप लोगो को यह आर्टिकल पसंद आया होगा यदि आया है .
तो आपके दोस्तों के साथ शेयर करें .
more articles
0 Comments