Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help with this JAVA coding problem: public class C ensoredWriter extends PrintWriter fields No fields are explicitly required, but you'll probably need to make
Please help with this JAVA coding problem:
public class C ensoredWriter extends PrintWriter fields No fields are explicitly required, but you'll probably need to make your own fields to track the string pattern to be censored and the string to replace the censored string: % ! ^*#@ constructors Note that PrintWriter has similar constructors to these, so each simple to write by invoking the parent constructing using super. . public CensoredWriter(OutputStream o, String c) o you have to call the parent class's constructor first; which one will you choose? owhat other work remains after the parent constructor call - do you have any fields that were introduced in this class that still need assigning? o Sample uses of this constructor are: CensoredWriter out - new CensoredWriter (System.out, "frack" out.println("Some text which contains frack and frack." o This constructor and the other two costructors should be very short, on the order of 1-2 lines. class constructor wil1 you call? given name. Which parent-class constructor will you call? . public censoredwriter(Pile f, string c) throws Exception. Same as above, but writes to the given file. Which parent- * public censoredWriter(string filename, string c)throws Exception. Same as above, but writes to the file with the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started