This junk won't work idk wtf is wrong with it. Mainly a double to int issue, can someone say what's up?
void
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
This junk won't work idk wtf is wrong with it. Mainly a double to int issue, can someone say what's up?
void
Please explain what "won't work" means? Show the program's output and explain what is wrong with it.This junk won't work
If there are errors, please copy the full text of the messages and paste them here.
If you don't understand my answer, don't ignore it, ask a question.
The problem is simple, I am using both ints and doubles and I apparently have to choose. The problem is that, while many of my variables are ints like DAT PAR SYS DAM PAM, some are doubles because they are not integers, like refluxRatio. My question is, if I want to put 0.3 reflux ratio for example, it tell me it's not an int...but I know it's not an int, it CANNOT be an int, it's a fkn ratio!!!!! So how do I make the compiler happy? How do I pass a 0.3 value?
Is it possible for me to convert everything into double? Will that be possible for a 2 dimensional array? Because there's loop counters like i, that have to be ints, so is it gona tell me, oh no we cant take ur doubles because the fkn counter is an int? Help please!
0.3 is a double and needs to be handled as a double. If you cast it to an int it will be 0want to put 0.3 reflux ratio for example, it tell me it's not an int.
If you don't understand my answer, don't ignore it, ask a question.
yes but then it tells me double to int mismatch...it wants both to be doubles or both to be int, you must have heard of this error before, idk how to explain it more...the loss of information thing? What should I do?
What line(s) is the compiler complaining about?
Please post the full text of the error message.it tells me double to int mismatch
Converting 0.3 to int would give 0.the loss of information
If you don't understand my answer, don't ignore it, ask a question.
I also get a "The field DistillationColumn.feedTray is not visible" thing for the super variables, super class:
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 31]
Error: The field DistillationColumn.feedTray is not visible
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 39]
Error: The field DistillationColumn.feedTray is not visible
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 39]
Error: The field DistillationColumn.trays is not visible
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 51]
Error: The field DistillationColumn.trays is not visible
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 64]
Error: The field DistillationColumn.feedTray is not visible
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 65]
Error: The field DistillationColumn.feedTray is not visible
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 66]
Error: The field DistillationColumn.trays is not visible
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 75]
Error: The field DistillationColumn.refluxRatio is not visible
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 78]
Error: The field DistillationColumn.refluxRatio is not visible
File: F:\Flash Tank 2\Flash Tank\Chemicals.java [line: 37]
Error: The left-hand side of an assignment must be a variable
File: F:\Flash Tank 2\Flash Tank\Chemicals.java [line: 46]
Error: The left-hand side of an assignment must be a variable
File: F:\Flash Tank 2\Flash Tank\DistillationColumn.java [line: 1]
Error: The type DistillationColumn must be an abstract class to define abstract methods
File: F:\Flash Tank 2\Flash Tank\DistillationColumn.java [line: 1]
Error: The type DistillationColumn must implement the inherited abstract method Equation.evaluateEquations(double, Stream)
File: F:\Flash Tank 2\Flash Tank\DistillationColumn.java [line: 23]
Error: The abstract method clone in type DistillationColumn can only be defined by an abstract class
--------------
** Warnings **
--------------
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 9]
Warning: The field BinaryDistillation.str is never read locally
File: F:\Flash Tank 2\Flash Tank\BinaryDistillation.java [line: 10]
Warning: The field BinaryDistillation.q is never read locally
That doesn't look like any compiler error message I've seen.Any idea what "not visible" means?
The variable in the message is private to the class its defined in.
Please post the full text of the compiler's error messages.
If you don't understand my answer, don't ignore it, ask a question.
Done, sorry I should have posted the error log before XD
--- Update ---
the trays is in the super constructor, I don't understand wtf is the problem ((
Can you explain what the problem is?the trays is in the super constructor
If you don't understand my answer, don't ignore it, ask a question.
The problem is that the program doesnt run because of the error I posted above. I want the program to run so I can go home and party
--- Update ---
Error: The field DistillationColumn.feedTray is not visible
--- Update ---
OHHHHHHHHHHHHHHHH I forgot the get accessor rofl! XD
P.S. Hmm, don't mean to be rude but, you guys know any Java at all lol? I'm getting weird feedback here haha
The field is private. It can not be accessed from outside of the class.
Add a get method to the class to read that field's value and return it to the caller.
You should spend more time reading the code and less posting.
If you don't understand my answer, don't ignore it, ask a question.
Isuck at Java man, doesn't help me to read, plus I got ADHD which makes reading even worst ^_______^
You'll have a hard time with programming if you can't read and understand documentation.
There is too much to remember so you have to read the API doc to get the details .
I read the API doc many times a day.
If you don't understand my answer, don't ignore it, ask a question.
In case you haven't noticed I'm a chemical engineer and the only reason I gotta do programming is because of my stupid pos program which requires us to do so. I don't care if they find this, I'm on a proxy so they won't know who wrote it anyways rofl.
If you're done, Please mark this thread as solved
If you don't understand my answer, don't ignore it, ask a question.
idk how, I'm noob