|
Thank you very much
|
|
|
|
|
im trying to create a tool. this tool need to read other source code?
what i know is using "token"
but i dont know how to code it using that "token".
I am a student. i hope that u all can help me to solve my problem
|
|
|
|
|
Google is your friend. The first result from 'token stream java' gives this[^].
Read. Try. Learn.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
thanx ya. i'll try to learn it
|
|
|
|
|
Hi, I am doing a project for school and i cannot for the LIFE of me figure out these enumerations. The problem in my book is as below:
Write a java enumeration LetterGrade that represents letter grades A through F, including plus and minus grades. Define a private instance variable holding a boolean value that is true if the grade is passing. Also, define a constructor that initializes this instance variable, an accessor method isPassing to return its value, and a method toString that returns the grade as a String. Finally, write a program that demonstrates the enumeration.
Now, this problem is not very precise as to what I need to pass into the enumeration, but my guess is the numerical grade, 1-100, as an integer. It then should determine if the grade is passing or failing, return that, and then return the appropriate letter grade as a string.
I have tried so hard and for so long to do this but I just cannot get it as all. How would I make an enumeration like this and implement it? I tried using something like you see below but I got so many errors I wanted to cry. How do I do this and make it work.T-T Its due this friday. =\
A+(95), A(93), A-(90), B+(88), B(85)...F(63), F-(60);
|
|
|
|
|
shawndeprey wrote: Hi, I am doing a project for school and i cannot for the LIFE of me figure out these enumerations.
I don't know what you have been taught about this but there is an article here[^] which should get you started.
|
|
|
|
|
|
Well the OP in the title and the message talks of "Enumerations", and also wants to use things like A, A+, A- etc, so I thought enums probably would not do.
|
|
|
|
|
Yes, you can use enums to do exactly what the OP wants. Enums in Java are more than simple integers. They can have constructors, they can override methods from Object like toString(), they can have their own methods for specific processing and their own private variables, all sorts of clever things.
Lots of people talk about "enumerations" when they really mean "enumerated types". I guess that whoever set this exercise didn't think about that (shock horror, teachers are human too).
An Enumeration in Java is really just a sort of iterator. When they introduced the enum keyword into Java it broke a lot of existing code because it was common practice to call your Enumeration variable enum, because that is what all the Sun examples did, and all of a sudden that became a restricted name.
|
|
|
|
|
Yes, I was aware of this, having lived through the frustration of using enums in C++ but not having them in Java, while I was working on a JNI library for a multi-platform project.
|
|
|
|
|
Yes, you are right, I realized my mistake after people started using both terms. What I really want to do is use enumerated types to solve this problem, I just still can't wrap my mind around how to do it. I understand the concepts of enumerated types, just not the implications. I don't get how enumerated types use or even create its variables. If somebody could make perhaps a short replica of what needs to be done here, say just A+, A, and A-, and explain just what is actually going on during processing, I think I could finally get a better handle on these tricky enumerated types.
Thank you for all your comments so far! I seem to have really started a discussion lol.
|
|
|
|
|
I still need mega help on this >.<
|
|
|
|
|
|
OH I THINK I AM STARTING TO UNDERSTAND! If I let the user enter an integer as a grade, I could have an if statement that would send the correct letter grade to the class of the enum, and the enum would output the appropriate grade AND decide with a simple Boolean if the grade is passing or failing. IT ALL ADDS UP! Thank you so much for the help! I think I can finally do this problem!
I am assuming that enum is in its own class because I think that is what the teacher wants us to do :P. But I understand the logic you are using.
|
|
|
|
|
we're currently making a trial application that will display a swf on java.
Can we have some more info on how to load swf in java.
|
|
|
|
|
dfan23 wrote: Can we have some more info on how to load swf in java.
You really need to make a greater attempt to do some research for yourself before posting these questions. Use Google and search for Java and SWF.
|
|
|
|
|
|
How to return a value from one class to another class ?
|
|
|
|
|
dfan23 wrote: How to return a value from one class to another class ?
Quote Selected Text
I presume you mean instance rather than class, but in either case it is the parameter on the return statement from a method call.
|
|
|
|
|
|
use the compositionrelation between classes
one clase use another this is the best
|
|
|
|
|
I'm building my first Android app at the moment and it all seems to work well. I guess it's less complex than your average MS app but the help seems helpful and all the methods seem to be explained well.
I've got one issue with debugging which is driving me mental though.
I haven't installed the source for android so if I cause an error inside the framework the debugger reports that it can't find the source. Now, i could install the source and point the debugger to where it's living and then I'd get the code to break inside the framework code but what I'd rather do if it's possible is to get the code to break at the last point in my code before it enters the framework (most of these errors are caused by things like typos of DB fieldnames). Does anyone know if this is possible and if so how I can do this?
Cheers
Russ
|
|
|
|
|
Hi guys,
I want to make a game for Nokia phones is java possible to make games for Nokia? Please guys if u know it tell me?
Thank u
|
|
|
|
|
Take a look here[^] for some suggestions.
|
|
|
|
|
Clever! Who would of thought to search Google...
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|