gs gs128 Java Classes Methods - Java String Class - Quiz No.1
gs gs128 Java Quiz
This quiz belongs to book/course code gs gs128 Java of gs organization. We have 136 quizzes available related to the book/course Java. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Java Classes Methods. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: String in Java is a?
class
object
variable
character array
Question 2: Which of these method of String class is used to obtain character at specified index?
char()
Charat()
charat()
charAt()
Question 3: Which of these keywords is used to refer to member of base class from a subclass?
upper
super
this
none of the mentioned
Question 4: Which of these method of String class can be used to test to strings for equality?
isequal()
isequals()
equal()
equals()
Question 5: Which of the following statements are incorrect?
String is a class
Strings in java are mutable
Every string is an object of class String
Java defines a peer class of String, called StringBuffer, which allows string to be altered
Question 10: What will be the output of the following Java program?
class string_class { public static void main(String args[]) { String obj = "hello"; String obj1 = "world"; String obj2 = "hello"; System.out.println(obj.equals(obj1) + " " + obj.equals(obj2)); } }
false false
true true
true false
false true