Question 1

Time: 00:00:00
In which package the String class is encapsulated in java?

java.util

java.util

java.lang

java.lang

Java.io

Java.io

None of the mentioned

None of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 2

Time: 00:00:00
String is immutable in java.

True

True

False

False

Can’t say

Can’t say

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
Which method in java is used to get the string representation of an object ?

toString()

toString()

hashcode()

hashcode()

Both a and b

Both a and b

None of the mentioned

None of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 4

Time: 00:00:00
In which of the following classes toString() method is overridden?

String

String

StringBuffer

StringBuffer

StringBuilder

StringBuilder

All of these

All of these

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
Object class toString() method internally calls which of the following methods?

hashCode()

hashCode()

equals()

equals()

getName()

getName()

getClass()

getClass()

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00
Object class equals() method meant for

content compression

content compression

reference compression

reference compression

Both A and B

Both A and B

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00
Which of these methods of String class is used to obtain character at specified index?

char()

char()

Charat()

Charat()

charat()

charat()

charAt()

charAt()

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
In java, which method is used to find the length of the string?

size()

size()

length()

length()

len()

len()

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 9

Time: 00:00:00
 How is Date stored in database?

java.sql.Date

java.sql.Date

java.util.Date

java.util.Date

java.sql.DateTime

java.sql.DateTime

java.util.DateTime

java.util.DateTime

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00
How to format date from one form to another?

SimpleDateFormat

SimpleDateFormat

DateFormat

DateFormat

SimpleFormat

SimpleFormat

DateConverter

DateConverter

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.