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


Download 0.82 Mb.
Pdf ko'rish
bet5/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 )

Comments in Java
Just as in the case of C++ and C, Java supports two types of comments namely, single line
comments  and  multi-line  comments.  The  syntax  for  these  types  of  comments  are  as
follows:
Single line comment:
//
Multiple line comment:
/**/
All characters that exist in the comments region are simply ignored by the Java compiler.
Using Blank Lines:
Any  line  that  is  only  composed  of  whitespace  characters  or  comments  is  considered  a
blank  line.  These  lines  are  just  ignored  by  the  compiler  and  are  not  included  in  the
executable.
Inheritance:
Java  supports  inheritance.  In  other  words,  it  is  possible  to  derive  one  class  from  another
class in this programming language. For instance, if you need to create a new class, which
is  an  extension  of  an  existing  class,  then  you  can  simply  derive  this  new  class  from  an
existing class. This allows the new class to access the elements already implemented in the
existing class. In this case, the new class is called the derived class and the existing class is
referred to as the super class.
Interfaces:
As  mentioned  previously,  Java  is  all  about  interaction  between  objects.  The  manner  in
which  different  objects  communicate  with  each  other  is  defined  in  what  is  called  an
‘interface.’ Moreover, interfaces are also an important aspect of the inheritance feature of
java. As  part  of an  interface,  the methods  that  can  be used  by  a derived  or  sub-class  are
declared.  However,  all  the  methods  declared  as  usable  for  the  subclass  must  be
implemented in the subclass.




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