Java Reserve Keywords

后端 未结 4 515
天命终不由人
天命终不由人 2021-01-29 02:48

Are generic, cast, and threadsafe reserved keywords in java? I am aware of the 52 keywords in java but looking for the new reserved keywor

4条回答
  •  日久生厌
    2021-01-29 03:35

    See this link here. It's the reserved keyword list for Java 6.

    
        abstract    continue  for           new            switch
        assert (c)  default   goto (a)      package        synchronized
        boolean     do        if            private        this
        break       double    implements    protected      throw
        byte        else      import        public         throws
        case        enum (d)  instanceof    return         transient
        catch       extends   int           short          try
        char        final     interface     static         void
        class       finally   long          strictfp (b)   volatile
        const (a)   float     native        super          while
    
        (a) not used
        (b) added in 1.2
        (c) added in 1.4
        (d) added in 5.0 
    

    So, no, neither of those three words you listed are in the reserved set.

    This keyword list can also be found in the Java language specification in section 3.9.

提交回复
热议问题