View the step-by-step solution to:

import static java.System.

import static java.lang.System.*;


public class FirstAndLast

{

private String word;


public FirstAndLast(String s)

{

word=s;

}


public void setString(String s)

{

word=s;

}

public String getWord ()

{

return word;

}


public String getFirst()

{

out.print(word.charAt(0));

return "";

}


public String getLast()

{

out.print(word.charAt((word.length())-1));

return "";

}


public String toString()

{

String output="n word :: "+word+"nfirst letter :: "+getFirst+"nlastletter :: "+getLast;

return output;

}

}

Top Answer

Here is the answer... View the full answer

2 comments
  • well it says alot cannot find symbols and im trying to figure out why it wont give me them in the String output
    • hunter5933
    • Apr 28, 2016 at 9:38am
  • It says two cannot find symbols in the String output line
    • hunter5933
    • Apr 28, 2016 at 9:40am

Sign up to view the full answer

Other Answers

It will give you compilation time error : FirstAndLast.java:35: error: cannot find symbol String output="n word ::... View the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online