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
    Location
    Allahabad
    Posts
    1
    Rep Power
    0

    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
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    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,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,994
    Rep Power
    5

    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
    Location
    Washington, DC
    Posts
    3,958
    Rep Power
    8

    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 - Play indie games, learn from game tutorials and source code, upload your own games!

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, 02:26 PM
  3. Replies: 8
    Last Post: 11-04-2010, 01: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
  •