user2903144
user2903144

Reputation: 51

Built in function in java

What is built in function in java? I found some question and it was like "... solve this without using built in function". So, what is it? I know java support methods,what's different between both of them?

Upvotes: 5

Views: 23538

Answers (5)

codeskin
codeskin

Reputation: 197

It's a method that is part of the Java class. Like String for example. These methods usually save time and effort as they are designed for optimal performance and have been well tested. This article helps explain with examples provided.

Upvotes: 0

75inchpianist
75inchpianist

Reputation: 4102

It means solve it using only methods that YOU have implemented. Do not use anything that came as a part of the JDK you installed.

JDK = Java Development Kit

It includes a rich library to assist with some of the more common tasks in java coding. It sounds like you are supposed to avoid using this library.

Upvotes: 3

Tarik
Tarik

Reputation: 11209

I would think that "built in function" within a language would rather mean intrinsic function. This is not the case of any function or class that are part of the JDK. These functions and classes are not part of the Java language per se. However, most probably, you have indeed been asked to avoid using any method or class belonging to the JDK although the expression is being used abusively.

Upvotes: 0

Shamse Alam
Shamse Alam

Reputation: 1315

Built in functions in java are methods that are present in different API of JDK. For example cos(double a), exp(double a) etc are built in function of java present in java.lang.Math class.

Solve without using built in functions means if you have to calculate X raised to the power of Y, you define your own logic to calculate the result. You don't use built in function Math.pow(X, Y), that returns the value of the first argument raised to the power of the second argument.

Upvotes: 3

Bucket
Bucket

Reputation: 7521

A built-in function is a method that is already implemented by the package you import. For example, if in your code you say,

import java.util.Collections;

And later use Collections.sort(...), you are using a built-in function, since you did not write it - the Java developers did.

If your requirements specify you must use a non-built-in function, you must write this sort() (e.g.) algorithm yourself.

TL;DR - Built-in functions are already made. A non-built-in function is one you write yourself.

Upvotes: 1

Related Questions