• Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Have any question?

(+91) 98222 16647
info@simplycoding.in
RegisterLogin
Simply Coding
  • Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Operators

Java Class Libraries and Packages

  • Categories Operators, Math Library, Java
Java Class Librares

Here we are going to learn above Java Class Libraries. You can watch our video to understand Java Class Libraries – Click Here

Q. 1 What is JCL?
Ans. Java Class Library (JCL) are dynamically loadable libraries that Java applications can call at run time. Some examples of JCL are java.lang, java.util, java.math, java.awt. etc.

Q. 2 What are packages? Why do we need packages?
Ans. Java contains an extensive library of pre-written classes (JCL) you can use in your programs. These classes are divided into groups called packages.  A Package is a collection of related classes, providing access protection and name place management.
Java uses packages because

  • It makes search and re-using packages and classes easier.
  • It prevents naming conflicts. You can have a class with same name in two different package.
  • Provides controlled access as you can specify protected and default access specifier for methods which work within a package

Q. 3 Which keyword is used to include packages in your source code?
Ans. import keyword is used to import built-in and user-defined packages into your java source file so that your class can refer to a class that is in another package by directly using its name.

Q. 4 Which package is automatically imported by Java?
Ans.     “ java.lang“ Package is automatically imported by Java.

Q. 5 Name the package that contains – 1) BufferedReader 2) Scanner 3) Math?
Ans.      1) BufferedReader: java.io
              2) Scanner: java.util       
              3) Math: java.lang

Q. 6 Which class is at root of Java Class Hierarchy?
Ans.    

i) Object class is at the root class hierarchy and Class, instances of which represent classes at runtime.
ii) They are part of java.lang package.

Q. 7 What is JAR?
Ans.    

  • A java library is deployed in a jar file format.
  • JAR or Java Archive is like a zipped file which contains many java classes and its associated resources such as images, text etc. into one file to distribute as libraries

Java Math Class : 

The java.lang.Math class contains various methods for performing basic numeric operations such as the logarithm, cube root, and trigonometric functions etc. The various java math methods are as follows:

MethodDescription
Math.abs()It will return the Absolute value of the given value.
Math.max()It returns the Largest of two values.
Math.min()It is used to return the Smallest of two values.
Math.round()It is used to round of the decimal numbers to the nearest value.
Math.sqrt()It is used to return the square root of a number.
Math.cbrt()It is used to return the cube root of a number.
Math.pow()It returns the value of first argument raised to the power to second argument.
Math.ceil()It is used to find the smallest integer value that is greater than or equal to the argument or mathematical integer.
Math.floor()It is used to find the largest integer value which is less than or equal to the argument and is equal to the mathematical integer of a double value.
Math.random()It returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
Math.rint()It returns the double value that is closest to the given argument and equal to mathematical integer.
Math.log()It returns the natural logarithm of a double value.
Math.exp()It returns E raised to the power of a double value, where E is Euler’s number and it is approximately equal to 2.71828.
Math.sin()It is used to return the trigonometric Sine value of a Given double value.
Math.cos()It is used to return the trigonometric Cosine value of a Given double value.
Math.tan()It is used to return the trigonometric Tangent value of a Given double value.

  • Share:
author avatar
Simply Coding

Previous post

Switching Techniques used in computer network
June 16, 2021

Next post

Conditional Statements in Java
June 16, 2021

You may also like

Questions on Encapsulation
Questions on Encapsulation
4 July, 2021
Questions on Library classes
Questions on Library classes
4 July, 2021
Questions on String 1
What is Java String?
3 July, 2021

Leave A Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Uncategorized
  • Programs
    • Python
    • Java
  • Problems
    • Python
    • Java
    • Web Development
      • Internet
    • Emerging Technologies
  • Notes
    • General
    • QBasic
    • MS Access
    • Web Development
      • XML
      • HTML
      • JavaScript
      • Internet
    • Database
    • Logo Programming
    • Scratch
    • Emerging Trends
      • Artificial Intelligence
      • Internet of Things
      • Cloud Computing
      • Machine Learning
    • Computer Fundamentals
      • Computer Networks
      • E-Services
      • Computer Hardware
    • Python
    • Java
  • School
    • ICSE
      • Computers Class 9
        • Java Introduction
        • Tokens & Data Types
        • Java Operators
        • Math Library
        • if & switch
        • For & While
        • Nested loops
      • Computer Class 10
        • Sample Papers
        • OOPS concepts
        • Functions in Java
        • Constructors
        • Arrays in Java
        • Strings in Java
    • SSC
      • IT Class 11
        • IT Basics
        • DBMS
        • Web Designing
        • Cyber Laws
      • IT Class 12
        • Web Designing
        • SEO
        • Advanced JavaScript
        • Emerging Tech
        • Server Side Scripting
        • E-Com & E-Gov
      • Computer Science 11
      • Computer Science 12
    • CBSE
      • Computer 9
        • Basics of IT
        • Cyber Safety
        • Scratch
        • Python
      • Computer 10
        • Sample Papers
        • Networking
        • HTML
        • Cyber Ethics
        • Scratch
        • Python
      • Computer Science 11
        • Computer Systems
        • Python 11
          • Python Basics
          • Python Tokens
          • Python Operators
          • Python if-else
          • Python loops
          • Python Strings
          • Python List
          • Python Tuple
          • Python Dictionary
          • Python Modules
        • Data Management
      • Computer Science 12
        • Sample Papers
        • Python 12
          • Python Functions
          • Python File Handling
          • Python Libraries
          • Python Recursion
          • Data Structures
        • Computer Networks
        • Data Management
    • ISC
      • Computer Science 11
        • Introduction to Java
        • Values & Data Types
        • Operators
        • if & switch
        • Iterative Statements
        • Functions
        • Arrays
        • String
        • Data Structures
        • Cyber Ethics
      • Computer Science 12
        • Sample Papers
        • Boolean Algebra
        • OOPS
        • Wrapper Classes
        • Functions
        • Arrays
        • String
Simply Coding Computer Courses for School                Privacy Policy     Terms of Use     Contact Us

© 2021 Simply Coding

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now