
JAVA:
There are three errors with the
import java.util.Scanner;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
public class MyClass extends AnotherClass, ThirdClass {
private int i;
private String s;
public MyClass(String s) {
this.s = s;
i = s.length();
}
public abstract int doSomething();
public void readString() throws IOException {
FileInputStream inFile = new FileInputStream("Text.txt");
Scanner scan = new Scanner(inFile);
s = scan.next();
i = s.length();
inFile.close();
scan.close();
}
public void writeString() throws IOException {
FileOutputStream outFile = new FileOutputStream("Text.txt");
PrintWriter pw = new PrintWriter(outFile);
pw.println(s);
outFile.close();
}
}


Step by stepSolved in 3 steps

- Please follow the directions correctly public class TestWord { public static void main(String[] args) { /* Word w1 = new Word("Go Cubs Go", "Cub"); System.out.println("New Word object"); System.out.println("Superclass word: " + w1.getSentence()); System.out.println("Subclass word: " + w1.getNoVowelsWord()); System.out.println("Is word a substring of sentence? " + w1.isSubstring()); System.out.println(); Word w2 = new Word("Applepie", "Apple"); System.out.println("New Word object"); System.out.println("Superclass word: " + w2.getSentence()); System.out.println("Subclass word: " + w2.getNoVowelsWord()); System.out.println("Is word a substring of sentence? " + w2.isSubstring()); System.out.println(); System.out.println("w1 and w2 are the same? " + w1.equals(w2)); */ } }arrow_forwardPlease help me with this question is in JAVA, will give thumbs up THANK YOU!arrow_forwardThe primary focus of this assignment is the use of interfaces. In programming, an interface is a public avenue by which data can be accessed and/or manipulated. five Java classes called Point, Circle, Square, Rectangle, and TestAll, as well as a Java interface called FigureGeometry. The TestAll class should implement the main method which tests all of the other files Point.java Description: Instance Variables: private int width;//stores the width of a Point object private private int height;//stores the height of a Point object Constructor: Point() Parameters: int theWidth, int theHeight Purpose: initializes the width and height of a Point object in the following manner: width = theWidth; height = theHeight; Methods: public int getWidth(){//returns the width of a Point object in the following manner return width;} public int getHeight(){//returns the height of a Point object in the following manner: return height;} public void setWidth(int theWidth){//assigns the width of a Point…arrow_forward
- USING JAVA: Part A) Implement a superclass Appointment and subclasses Onetime, Daily, and Monthly. An Appointment has a description (for example, “See the dentist”) and a date. Write a method, occuresOn(int year, int month, int day) The check whether the appointment occurs on that date. For example, for appointment, you must check whether the day of the month matches. This fill an array of Appointment objects with a mixture of appointments. Have the user enter a date and print out all appointments that occur on that date. Part B) Improve the appointment book by giving the user the option to add new appointments. The user must specify the type of the appointment, the description, and the date.arrow_forwardFor beginning Java, two things 1) I got this error from my code and how and where can I fix it: Main.java:133: error: reached end of file while parsing } ^ 1 error 2) I was told my code is too long and needs to be separate files. How can I fix this into separate Java files? 3) I need to Draw the UML diagram using MS Word or PowerPoint for the classes and implement them. My original assignment is attached. Here's my code: import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.time.LocalDate; class Person { private String name; private String address; private String phoneNumber; private String emailAddress; public Person(String name, String address, String phoneNumber, String emailAddress) { this.name = name; this.address = address; this.phoneNumber = phoneNumber; this.emailAddress = emailAddress; } @Override public String toString() { return "Person: " + name + "\nAddress: " + address…arrow_forwardjavaarrow_forward
- In Java, a class can only inherit from one other ------- . A class can, however, extend many ----------.arrow_forwardJAVAarrow_forwardJava. Code: public class Person{// PLEASE START YOUR CODE HERE// *********************************************************// *********************************************************// PLEASE END YOUR CODE HERE//constructorpublic Person(String firstName, String lastName){this.firstName = firstName;this.lastName = lastName;}public String toString(){return firstName + " " + lastName;}}arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





