I'm having an issue with getting this attempted program to work. When I try to run this program in oracle, the console flickers, then it says terminated. I'm not getting any output. I believe I have made a mistake with the way I am using the class Project3StringInstrument. Below are the two classes ,which are in the same package, hat i am referring to. I am attempting to test the first class with my second class. Am I calling the methods wrong? Is there a functionality of methods and classes that I'm not aware of? Thank you for your help.
Thank you for adding the code tags. Unfortunately, that accentuates the excessive line length in your post which makes the code difficult to read; I have broken the lines so you can see how to do it. You should not use tab characters anywhere. Set up automatic indentation and conversion of tab→4 spaces on your text editor.
The use of the word “Oracle” is a red herring. You are simply using the Oracle JVM, but you would get the same results from any JVM. You are not calling any code anywhere which prints anything You have print instructions but you never get to use them. There is a little mistake, which I am sure everybody here has made themselves (or similar) in the code to enter the loop.
That is the minor mistake. Unfortunately the rest of the code is not object‑oriented code, and you are going to hate me for what I shall say next. You should start again. You should have a String class and an Instrument class. Each String can have a name field (and maybe also frequency), but a Note class might be even better. Then the String can have a Note field. and the Note can record name and frequency.
You can have an Instrument class with a String and name fields. Project3StringInstrument is a bad name for the class; it is particularly bad that the 3 might refer to how many Strings or which Project. Each of the 3 classes I named should have one constructor which initialises its fields to sensible values. Remember: to initialise an array you want to initialise its individual elements, too. You don'need a count with an array, because arrays always count how many elements they can contain.