Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ICICI LIIC YUCULIUIS IIUI JLI IUSQUIZ 1. String is a primitive datatype Optional Answers: 1. True, Strings are primitives since their close cousin, chars, are

image text in transcribedimage text in transcribed

ICICI LIIC YUCULIUIS IIUI JLI IUSQUIZ 1. String is a primitive datatype Optional Answers: 1. True, Strings are primitives since their close cousin, chars, are also primitive 2. False, String is a reference variable 3. False, String is a char variable 4. True, Strings hold primitives, therefore it is a primitive 2. "\t" is an escape key for Optional Answers: 1. next line 2. T-Layout 3. tab 4. null 3. double number = 5; double number2 = number; Which is true? Optional Answers: 1. There is a compilation error since only a String can be assigned to another String 2. They each contain a reference to a single location since they were assigned to each other 3. They reference the locations of 2 separate objects 4. They each contain separate values in separate locations each though they were assigned to each other 4. char c="my code does stuff".charAt(9); What is the value of c? Optional Answers: 1. null 2. d 3.0 4. Compiler error, charAt takes in only chars as parameters example: hello.charAt('h'); 5. int x="Hello world".length(); What is the value of x? (look up length() in the java api) Optional Answers: 1. Invalid, you cannot call methods this way 2. 11 3.9 4.8 6. String s="Nerf This!".substring(0,6); What is the value of s? Optional Answers: 1. Nerf 2. Nerf Th 3. Nerf T 4. Runtime Error - You cannot call methods like this

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions