201 Flashcards

1
Q

Say me PI & Exponent Constant from java.lang.Math class

A

double E

doble PI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why we need utilities like this Math Class?

A

As java is subjective, there are times when we do not have the time to write the implementation & at the same time to save the DRY principle, it is good to use utilities & carry our work. But we should keep practising to write utilities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Say the method for trigonometric functions from java.lang.Math class?

A
double sin(double a)
double cos(double a)
double tan(double a)
double asin(double a)
double acos(double a)
double atan(double a)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the function for exp & log in java.lang.Math class?

A
double exp(double a)
double log(double a)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the most general argument type and return type of Math class?

A

double

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the function for sqrt & pow in Math class?

A
double sqrt(double a)
double pow(double a, double b)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the function for ceil & floor

A
double ceil(double a )
double floor(double a)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Is there a function to generate a random int in MAth class?

A

Yes, double rint(double a)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can we do a round of double and float?

A
int rount(float a )
double round(double a)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If float and double both belongs to Float type, then why we have two overloaded methods for float and double

A

TBF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is java.lang.StrictMath class?

A
The StringtMAth class is more standaridsed, providing more functions compare to java.lang.Math class.
In case if portability is a concern, we should use StrictMath class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is overflow and underflow in Math

A

TBF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to obtain the cuberoot in StrictMath?

A

static double cbrt(double a)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Does many methods in StrictMath are static?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to return the hyperbolic cosine?

A

static double cosh(double a)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does a switch statement takes in?

A

Char, String, Integer

17
Q

Why are for each loops are used?

A

Fot each is good way where you need not to do validations for null or something. At the same time the for each works for Arrays, Collections, Enums, MAps & Properties

18
Q

For Which Operator String class is overloaded

A

+ Operator

19
Q

If you see data coming in as stream of characters what will you do?

A

It may be byte data , or stream or case of deairrializatuon

20
Q

What is 409 Conflict http code?

A

The HTTP 409 Conflict response status code indicates a request conflict with current state of the server.

Conflicts are most likely to occur in response to a PUT request. For example, you may get a 409 response when uploading a file which is older than the one already on the server resulting in a version control conflict.

Status
409 Conflict