Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How to add java libraries

0 votes
asked Jul 2, 2019 by Prasadvzole (120 points)

1 Answer

0 votes
answered Jul 4, 2019 by Vandan Mehta (180 points)
If you wish to add inbuilt java libraries to your program in order to use their functions, you will use the import statement. following is the syntax for the import statement:-

import java.lang.Math;

With the help of this statement, you can use the functions Math.sqrt(),Math.abs etc

Over here, Lang is a folder full of Java libraries and Math is just one file which allows you to use the functions associated with the object Math. if you wish to import multiple files from one same folder you can replace the name of the object by *. For example

import java.lang.*;

The above statement will allow you to use all the object within the package "lang".

Hope this helps
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...