Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Practice Answer the following questions in a text or word processing file. Given the following declaration for a String object named aString, identify what is

Practice

Answer the following questions in a text or word processing file.

Given the following declaration for a String object named aString, identify what is assigned to the given variable or object for each string operation A-H. You can of course execute the code yourself if you wish. If the given operation would produce an exception or error, note that instead.

String aString = new String("Delta College - CST 183");

A. String string1 = aString.substring(9,12);

B. int location1 = aString.indexOf("CST");

C. char char1 = aString.charAt(21);

D. int location2 = aString.lastIndexOf("e");

E. String string2 = aString.substring(20,24);

F. boolean result1 = aString.endsWith("College");

G. boolean result2 = Character.isLetterOrDigit(aString.charAt(14));

H. boolean result3 = Character.isDigit(aString.charAt(20));

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

1. What are the pros and cons of diversity for an organisation?

Answered: 1 week ago

Question

1. Explain the concept of diversity and equality in the workplace.

Answered: 1 week ago