Java Reserved Words

Java Reserved Words

Java Reserved Words A reserved word in Java is a special word that gets recognized by the compiler. When the compiler sees a reserved word, it is prompted to do a unique task. Reserved words cannot be used for any other purpose in Java, besides their unique task. Below is a list of the words and their purpose. You may not understand all of the terms listed below, but you should familiarize yourself with them before you start programming. 1. boolean – used for declaring a type boolean 2. break – a reserved word in java that will immediately break out of the loop 3. byte - used for declaring a type byte 4. catch – used to handle exceptions 5. char - used for declaring a type char 6. class – used for creating a new class 7. do – used to declare a do-while loop 8. double – used for declaring a type double 9. else – contains a block of code to do if the “if-statement” is false 10. final – a reserved word in java that declares a value in java to be a constant 11. float - used for declaring a type float 12. for – used to declare a for loop 13. if – used to make an if statement 14. int - used for declaring a type int 15. long - used for declaring a type long 16. new – used for declaring a new Object, Array, or ArrayList 17. private – used to declare something as private, or not able to be accessed 18. return – a word in java used to return a value in a method 19. short - used for declaring a type short 20. static – used to declare something as static, or shared 21. switch – used to declare a switch statement 22. throw – used to avoid handling the program crashing 23. try – contains text that will be “caught” and handled if the program crashes 24. void – declares that a method does not return any value 25. while – used to declare a while loop .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us