YouTube Icon

Interview Questions.

Top 100+ Java.lang Package Interview Questions And Answers - May 31, 2020

fluid

Top 100+ Java.lang Package Interview Questions And Answers

Question 1. What Is The Base Class Of All Classes?

Answer :

java.Lang.Object

Question 2. What Do You Think Is The Logic Behind Having A Single Base Class For All Classes?

Answer :

Casting
Hierarchical and item oriented shape.
Adv Java Interview Questions
Question three. Why Most Of The Thread Functionality Is Specified In Object Class?

Answer :

Basically for interthread communication.

Question four. Is String A Wrapper Class Or Not?

Answer :

No. String isn't always a Wrapper class.

Adv Java Tutorial
Question five. How Will You Find Length Of A String Object?

Answer :

Using duration () approach of String magnificence.

J2EE Interview Questions
Question 6. How Many Objects Are In The Memory After The Exaction Of Following Code Segment?

Answer :

String str1 = "ABC";

String str2 = "XYZ";

String str1 = str1 + str2;

There are three Objects.

Question 7. What Is The Difference Between An Object And Object Reference?

Answer :

An object is an example of a category. Object reference is a pointer to the object. There can be many references  to the equal object.

J2EE Tutorial Core Java Interview Questions
Question 8. What Will Trim () Method Of String Class Do?

Answer :

Trim () put off spaces from each the ends of a string.

Question nine. What Is The Use Of Java.Lang. Class Class?

Answer :

The java.Lang. Class magnificence is used to symbolize the lessons and interfaces which are loaded through a java application.

JSP Interview Questions
Question 10. What Is The Possible Runtime Exception Thrown By Sub String () Method?

Answer :

ArrayIndexOutOfBoundsException.

Core Java Tutorial
Question eleven. What Is The Difference Between String And String Buffer?

Answer :

Object's of String elegance is immutable and object's of StringBuffer elegance is mutable furthermore String buffer is quicker in concatenation.

Java-Springs Interview Questions
Question 12. What Is The Use Of Math Class?

Answer :

Math class provides techniques for mathematical functions.

Adv Java Interview Questions
Question thirteen. Can You Instantiate Math Class?

Answer :

No. It cannot be instantiated. The class is very last and its constructor is personal. But all the techniques are static, so we will use them with out instantiating the Math class.

JSP Tutorial
Question 14. What Will Math.Abs () Do?

Answer :

It surely returns the absolute cost of the fee supplied to the approach, i.E. Offers you the identical cost. If you supply terrible value it surely gets rid of the signal.

Question 15. What Will Math. Ceil() Do?

Answer :

This technique returns usually double, which isn't much less than the furnished cost. It returns subsequent to be had complete range.

JMS(Java Message Service) Interview Questions
Question 16. What Will Math. Floor () Do?

Answer :

This method returns always double, which is not more than the provided fee.

Java-Springs Tutorial
Question 17. What Will Math.Max () Do?

Answer :

The max () method returns greater price out of the supplied values.

Java applet Interview Questions
Question 18. What Will Math.Min () Do?

Answer :

The min () technique returns smaller cost out of the provided values.

J2EE Interview Questions
Question 19. What Will Math. Random () Do?

Answer :

The random () method returns random range among zero.0 and 1.Zero. It continually returns double.

Java Tutorial




CFG