Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

WAP copy string to another string using class object in java. what is coding for that?

+1 vote
asked Jun 27, 2021 by kunjal kanani (640 points)

1 Answer

0 votes
answered Jun 28, 2021 by Peter Minarik (86,640 points)

Similarly to http://question.onlinegdb.com/10339/merge-array-particular-position-that-position-given-user-java?show=10342#a10342, you should first

  1. Clear the requirements. How do you copy the string from source to target?
    1. Replace the string? If source is shorter, will target only contain characters from source?
    2. Overwrite characters? If source is shorter, the remaining characters are kept in target after source has been written in there?
    3. Concatenate? Keep target's content intact and insert source right after target's original content is finished?
  2. Then try to do the implementation yourself.
  3. When you run into a problem, post your (clarified) requirements and your attempt to solve the problem so people can have a look and point out how it could be done (better).
Good luck!
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...