Basics of Java Pt.2




There are some things you need to remember before coding Java. Before you start
  • You need to create a project
  •  Create your class under the project you want
  •  Always start with:                                                                                                                         Public static void main (string [] args)
  •  remember to use a scope “ { “ at the end of public static void main(string[] args)
  •  after you’re done with your coding:                                                                            System.out.println();
  • and you need close the scope “}” after typing system.out.println();
  • If you open with many scopes; you need close every scope that was used in the beginning
 You can’t code the way you want; then how? Java special words called Primitive Types.
They are given below:
    Image result for Java
  1.          boolean
  2.          byte
  3.          char
  4.          short
  5.          int
  6.          long
  7.          float
  8.          double

Here are the features:

Category
Types
Size(bits)




Interger
byte
8
char
16
short
16
int
32
long
64
Floating- point
float
32
double
64
Other
boolean
1

  •     Boolean is true or false.
  •   Void is also another primitive type tells which the compiler that main () does not return a value.




Comments

Popular Posts