|
How does it not work, is ddirection a local variable or a class one. If it is a local one what is the initial value.
That being said why are you doing the same thing in the direction == Direction.UP if block as in the else block.
|
|
|
|
|
I am not sure quite what your values may be for this variable, but if you want it to lie only within the range 0.0 to 8.0, then what is wrong with:
if(ddirection > 8.00)
{
ddirection = 8.00;
}
else if(ddirection < 0.00)
{
ddirection = 0.00;
}
|
|
|
|
|
Member 7991625 wrote: What else can i do?
fix it.
1. there is a blatant mistake, actually a very small one (about the size of half a character) with big consequences. And you should have gathered it by observing the actual behavior (or simply by reading the code, which is what you made us do).
2. once the big error is fixed, there still is a little extra flaw: you have organized it such that you first need to get outside the valid range in order to change directions. That isn't very good, you should predict you're going to leave the range and then prevent that.
|
|
|
|
|
half a character
@ Member
Rename that Double-Value, your variables are quite similar, which makes it harder than needed to read the code.
Easy to read == Easy to maintain.
(EDIT: did I really make a "==" )
regards Torsten
I never finish anyth...
|
|
|
|
|
I think that you want ddirection to oscillate between two values every time this code is executed so,
(initialize ddirection at 0.0
{
ddirection = 8.0 - ddirection;
direction = (ddirection == 0.0) ? direction.DOWN : direction.UP;
}
|
|
|
|
|
could any one can explain about ontology ?
|
|
|
|
|
|
but there were soo many definitions at soo many situations...
so i want to be clear what s ontology in information science...
its definition says conceptualization of a specific domaim...
what does that really mean... ?????
|
|
|
|
|
Sorry, I don't know, you will need to research it. This is a Java technical forum, and your question is some way outside of the subject.
|
|
|
|
|
sry.. ontology s a general concept..
there s a separate api fof this ontology is jena ontology tool.. so nly i askd
|
|
|
|
|
|
im new to this site..
im interested in java programming...
could any one help me how to begin it ???
|
|
|
|
|
|
can i get some tutorials and sample projects ?
|
|
|
|
|
|
Hi all,
I'm doing a sort of academic work for university and I'm looking for how JPA manages different data stores (I have to compare and contrast this with ADO.NET)...
Does anyone can give me an advide for some docs explain this behavior? I've found only that Java connects to every and only JDBC data sources defining properties for conn. in persistence.xml or using a JNDI connection wherever the JDBC data source is mapper in the application server....
Thanks
Ste
Ste
|
|
|
|
|
once you've connected to the DB, the mechanics of storage are down to the database itself. What is being stored is well documented in theJPA specification [links at the end of the page][^]
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
|
Wow, Java with command prompt!! Sure bring back memories.
My favorite IDE for Java is always NetBeans[^]. But make sure you ask for permission if you want to use NetBeans in class, some basic Java is easier to grasp in command prompt.
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
Okay, thanks. will do.
Sir.Dre
|
|
|
|
|
For learning Java, I would recommend BlueJ[^]. It was designed specifically for use in education.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
use Eclipse - that's the classic one.
regards Torsten
I never finish anyth...
|
|
|
|
|
netbean is good editor for java .you can download it from oracle site
|
|
|
|
|
I would personally go for BlueJ. It is lightweight and it does not contain too many features that you may not utilize in the long run.
Netbeans is okay. There are tons of features available for you. Furthermore, it has several variation depending on what kind of language that you want to develop your program with. Netbeans is very useful if you want to use several languages.
I am not too sure about Eclipse though. The last time I used it is for testing out the Android emulator.
And all three of them are free!
|
|
|
|
|
Eclipse and NetBeans are the best IDE for java.
NetBeans provide good interface like visual studio of Microsoft.
|
|
|
|