Java: Java Programming For Beginners a simple Start To Java Programming (Written By a software Engineer)


Download 0.82 Mb.
Pdf ko'rish
bet4/95
Sana09.01.2022
Hajmi0.82 Mb.
#261112
1   2   3   4   5   6   7   8   9   ...   95
Bog'liq
Java Programming For Beginners - A Simple Start to Java Programming ( PDFDrive )

Java Identifiers
All  Java  components  require  names.  Names  utilized  for  classes,  variables  and  strategies
are called identifiers. In Java, there are a few focuses to recall about identifiers. They are
as per the following standard:
All identifiers ought to start with a letter (beginning to end or a to z), underscore
(_) or special character ($).
After the first character, identifiers can have any mix of characters.
You cannot use a keyword as an identifier.
Most significantly, identifiers are case sensitive. So, Sample is not same as sample.
Examples of identifiers include $salary, age, __1_value and _value.
Examples of illicit identifiers include –compensation and 123abc.
Java Modifiers
Like  is  the  case  with  any  programming  language,  it  is  conceivable  to  alter  classes  and
systems by utilizing modifiers. There are two classifications of modifiers:
Access Modifiers: public, default, protected and private
Non-access Modifiers: strictfp, final and abstract
We will be researching more insights about modifiers in the following chapters.
Java Variables
Several types of variables are supported by Java. These types of variables include:
Instance Variables (Non-static variables)
Class Variables (Static Variables)


Local Variables
Java Arrays
Arrays are contiguous memory locations that store different variables of the same sort. On
the  other  hand,  an  array  itself  is  an  article  on  the  memory.  We  will  research  how  to
proclaim, develop and instate these in the chapters to follow.
Java Enums
Enums were introduced as part of the Java package in java 5.0. Enums limit a variable to
have  one  of  just  a  couple  of  predefined  qualities.  The  qualities  in  this  identified  list  are
called  enums.  With  the  utilization  of  enums  it  is  conceivable  to  diminish  the  quantity  of
bugs in your code. Case in point, in the event that we consider an application for a cafe, it
would be conceivable to limit the mug size to extra large, large, medium and small. This
would  verify  that  it  would  not  permit  anybody  to  request  any  size  other  than  the  sizes
mentioned in the menu or application listing.
Please  note  that  enums  can  be  pronounced  as  their  own  or  inside  a  class.  However,
routines, variables, constructors can be created inside the body of enums as well.
Java Keywords:
Keywords or reserved words in Java are shown in the table below. As a rule, these words
cannot be used as names for variables or constants.
assert
abstract
break
boolean
case
byte
char
catch
const
class
default
continue
double


do
enum
else
final
extends
float
finally
goto
for
implements
if
instanceof
import
int
long
interface
new
native
private
package
protected
return
public
static
short
super
strictfp
synchronized
switch
throw
this
transient
throws
while
try


volatile
void

Download 0.82 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   95




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling