Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By KevinWorkman

Thread: java.lang : Is lang a class?

  1. #1
    Join Date
    Jul 2014
    Rep Power

    Default java.lang : Is lang a class?

    I am new to Java :

    I would like to know when we access a Math function,

    Math is a class we know, but is Math class inside class lang ??

    As in is Math class a nested class??

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power

    Default Re: java.lang : Is lang a class?

    'lang' is a package and so is 'java'; 'lang' is a 'sub package' of 'java'.

    kind regards,

    I have the stamina of a seal; I lie on the beach instead of running on it.

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Rep Power

    Default Re: java.lang : Is lang a class?

    Quote Originally Posted by JosAH View Post
    'lang' is a 'sub package' of 'java'.
    I've always found the term 'subpackage' misleading. In my eyes there is no such thing. java is a package, java.lang is another package. They have no relation with each other at all.

    But the JLS uses the term too, so I'll have to accept its existence.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: java.lang : Is lang a class?

    These questions can be answered by taking a look at the API: Java Platform SE 8

    You've got the java.lang package: java.lang (Java Platform SE 8 )
    The java.math package: java.math (Java Platform SE 8 )
    And the Math class, in the java.lang package: Math (Java Platform SE 8 )
    gimbal2 likes this.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

Similar Threads

  1. java.lang.String cannot be cast to java.lang.Boolean
    By putapepe in forum New To Java
    Replies: 7
    Last Post: 04-06-2014, 10:34 PM
  2. Replies: 5
    Last Post: 03-17-2011, 03:26 PM
  3. Replies: 8
    Last Post: 11-04-2010, 02:46 PM
  4. Replies: 5
    Last Post: 06-02-2010, 01:05 PM
  5. Replies: 3
    Last Post: 06-01-2010, 03:01 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts