Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You use the operator to access members of an object. (). % * You can declare var

ID: 3582891 • Letter: Y

Question

You use the operator to access members of an object. (). % * You can declare variables of the same name in a method if they are in non-nesting blocks. false true You can create an instance of the Math class. false true A source code file may contain several classes. false true You can declare variables of the same name in a method even though they are in the same block. true false quizzes for Chapter 9 You compare two strings si and s2 using. compare (s1, s2) compare To(s1, s2) s1.compare(s2) s1.compareTo(s2) To get a string from the StringBuffer, you use the toString method. true false Assume that the ASCII code for character c is 99 and for a is 97 what will be displayed by the following code? System.out.println("AB" + 'a' + 'c'); ABac ABa99 AB196 AB9799 the replace method in the String class replaces a character in the string. So it does change the content of the string. false true Which of the following statements are incorrect? char c = "r"; int k - null; String s = 'r'; float f = 4.5;

Explanation / Answer

6)b


dot operator is used to acces members of objects

eg: strcpy(emp.first_name, "chegg");


7.false


no we cant declare variables of the same name in a method if they are in non-nesting blocks.

y because local variable declarations space of a block must includes any nested blocks. Thus, it is not possible to declare a local variable with the same name

8.
false

no we are not able to create an instance of the Math class

y because v can't create an instance of any class when the only constructor is private.

9.

true

s source code can contain several classes

y beacause A source file may contain an unlimited number of non-public class definitions


10

false


You cant declare variables of the same name in a method even though they are in the same block


y beause it only happens in non nested blocking metods

11.


compare to


eg: s1.compareTo(s2));

12.

true

to get a string from the stringbuffer you use the tostring method


eg;
String str = sbwf.toString();

13.

c.

AB196


here AB is string and for a and c we have to assign values

14.


true

replace method replaces the characters so it does the content change


15;


string s='r' is an in correct one

it cant be declared like above


16:

b


2 is the answer
as it parser the value

a strName As String

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote