Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!