The Artima Developer Community
Sponsored Link

Java Buzz Forum
Top 10 uses of Java Keywords

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
instanceof java

Posts: 576
Nickname: instanceof
Registered: Jan, 2015

instanceof java is a java related one.
Top 10 uses of Java Keywords Posted: Feb 11, 2015 8:42 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by instanceof java.
Original Post: Top 10 uses of Java Keywords
Feed Title: Instance Of Java
Feed URL: http://feeds.feedburner.com/blogspot/TXghwE
Feed Description: Instance of Java. A place where you can learn java in simple way each and every topic covered with many points and sample programs.
Latest Java Buzz Posts
Latest Java Buzz Posts by instanceof java
Latest Posts From Instance Of Java

Advertisement

Keyword:

  • Keywords are predefined identifiers available directly throughout the JVM.
  • They have a special meaning inside java source code and outside of comments and strings.
  • For Example : public, static, void

Rules:

  • Keywords can not be used as user defined identifier by the programmer either for variable or method or class names, because keywords are reserved for their intended use.
  • All characters in keyword must be used in lower case.

Need of keywords:

  • Basically keywords are used to communicate with compiler and JVM about the operation we perform in java application.
  • In java we perform 10 different operations using keywords
  • They are:

  1. Creating Java file
  2. Storing data temporary
  3. Creating memory locations
  4. Controlling calculations
  5. Setting accessibility permissions
  6. Modifying default properties
  7. Object representation
  8. Establishing relations between classes
  9. Grouping classes
  10. Handling user mistakes

  • In java we have 50 keywords to perform all above 10 operations
  • Among them 47 introduced in java 1.0
  • In Java 1.2 new keyword "strictfp" was added.
  • In Java 1.4 new keyword "assert" was added
  • In Java 5 new keyword "enum" was added

  • Among 50 keywords 2 keywords are reserved words they can not be used in java program, because they defined but they are not implemented , those two are,
  1. goto
  2. const
     

1.Java Files

1.class
2.interface
3.enum

2.Data Types

4.byte
5.short
6.int
7.long
8.float
9.double
10.char
11.boolean
12.void

3.Memory Location

13.static
14.new

4.Control Statements

1.conditional

15.if
16.else
17.switch
18.case
19.default

2.loop

20.while
21.do
22.for

3.transfer

23.break
24.continue
25.return

5.Accessibility Modifiers

26.private
27.protected
28.public

6.Modifiers

28.static // used as modifier and class level memory allocation
29.final
30.abstract
31.native
32.transient
33.volatile
34.synchronized
35.strictfp

7.Object Representation

36.this
37.super
38.instanceof

8.Inheritance Relationship

39.extends
40.implements

9.Package

41.package
42.import

10.Exception Handling

43.try
44.catch
45.finally
46.throw
47.throws
48.assert

11.Unused keywords

49.const
50.goto

Default literals:

1.referenced literal
  ->null
2.boolean literals
->true
->false

Read: Top 10 uses of Java Keywords

Topic: Plug into the Wall: Interfaces to the Outside World Previous Topic   Next Topic Topic: Top 10 Easy Performance Optimisations in Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use