Keywords in Java

Java provide wide range of keywords to us. Every keyword has some special meaning in java. you can not use any keyword as class name or as a variable name.

All keywords has some predefined meaning which java compiler knows very well for example if you are using " while " keyword then compiler know very well that we are going to define a loop. Like other programming languages java have some common keywords like if, for. But it also has some special keywords like byte, implements.

Keywords in Java  learn java free owlbuddy.com


Keyword List in Java: -

  • abstract: - We use abstract keyword with class name. We can not create instance of abstract class
  • boolean: - We use boolean keyword with variable to define variable of boolean data type. boolean is special kind of data type in java and boolean variable can hold only two values(true/false)
  • break: - break keyword is use to break the normal flow of statement we normally use this keyword with switch but we can also use this with if statement
  • byte: - byte keyword is use to define a variable. byte is special kind of data type in java and byte variable only can save 8-bit datavalue
  • case: - case keyword we use while working with switch statement to define different case in switch.
  • catch: - catch keyword we use with try keyword and it helps us in Exception handling.
  • char: - char keyword we use with variable to define variable of char data type.
  • class: - class keyword use to create class.
  • do: - do keyword is use to define loop in java.
  • double: - double keyword is use to define a variable of double data type.
  • else: - else keyword we use with if keyword we use this keyword to define negative part of if statement.
  • extends: - we use extends keyword to perform inheritance in java in simple words to get features of one class into another class.
  • final: - final keyword is use to define constant in java or to define non-override-able method in java.
  • finally: - we use finally keyword to define finally block in exception handling.
  • float: - float keyword is use to define variable of float data type in java.
  • for: - for keyword is use to define loop in java.
  • if: - if keyword is use to define branching statement in java. In case of if statement if block will only run if condition in if statement would true.
  • implements: - implements keyword is use to inherit an interface in class.
  • import: - import keyword is use to import package in program.
  • int: - int keyword is use to define variable of int data type in java.
  • interface: - interface keyword is use to define interface in java.
  • long: - long keyword is use to define variable of long data type in java.
  • new: - new keyword is use to create new object of class.
  • package: - package keyword is use to define package in java.
  • private: - private keyword is use to define access modifier of class, variable or method.
  • protected: - protected keyword is also use to define access modifier of class, variable or method.
  • return: - return keyword is use to give back return after execution of method.
  • short: - short keyword is use to define variable of short data type.
  • static: - static keyword is use to define static variable in java. This keyword is mainly use for memory management
  • super: - super keyword is like a reference variable and this keyword references to object of parent class.
  • switch: - switch keyword is use to define switch statement in program it is part of control flow.
  • this: - this keyword is life a reference variable and this keyword references to object of cruuent class.
  • throw: - throw keyword is use in Exception handling. it use to throw explicitly Exception in program
  • throws: - throws keyword is use in Exception handling.Checked exception can be propagated with throws.
  • try: - try keyword is use in mention part of code where exception may occur in program.
  • void: - void keyword is use in to define return type of function in java. void mean function will return nothing.
  • while: - while keyword is use to



Share this tutorial with your friends on your social Media..

Keywords in Java Keywords in Java Keywords in Java Keywords in Java



Now You Can Follow All These Tutorials on Your Android Mobile Just Download This App.


Owlbuddy.com