Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA LANG PACKAGE Create a NetBeans project for this activity. 1: Create a new class with attributes name and address. Both data type will be

JAVA LANG PACKAGE

Create a NetBeans project for this activity.

1: Create a new class with attributes name and address. Both data type will be String. Create a constructor and assign the parameters to the attributes. Now override the to String() method.

2: Create a class with the main method and create an instance of the class that you created

3: Create an instance of the string in your test class and assign a value.

4: Now create an String and assign a value with spaces in the beginning, end and middle. Try out the method trim().

5: In your test class with main method, instantiate a string buffer with the initial value of hello. Use the method setLength with parameter 2. Print the string representation of the StringBuffer using toString().

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

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

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions