|
-
October 25th, 2009, 03:10 AM
#1
Several more questions. :-/
Ok after working with java for a GOOD while I have a few more questions about java.
If I made multiple threads for different functions would it be faster then if I just made one thread for all functions?
What is the point of OOP if you can just assign the variable to that object anyways without the need for OOP? I understand that in most cases with applications OOP is very important but with applets I don't seem to have much use for it. Perhaps later....
Is using built in shapes (Lines, Rectangles, Ovals) faster then using images? I would think so.....
Is using an array for 10 variables faster then actually assigning 10 different variables? Also would think so....
Sorry I have so many questions...
Well so far I REALLY like Java. More then any other programming language for that matter. Plus it is cross-platform so that is another bonus. :-D
Last edited by David2010; October 25th, 2009 at 11:35 AM.
-
October 25th, 2009, 11:38 AM
#2
Re: Several more questions. :-/
 Originally Posted by David2010
Ok after working with java for a GOOD while I have a few more questions about java.
If I made multiple threads for different functions would it be faster then if I just made one thread for all functions?
What is the point of OOP if you can just assign the variable to that object anyways without the need for OOP? I understand that in most cases with applications OOP is very important but with applets I don't seem to have much use for it. Perhaps later....
Is using built in shapes (Lines, Rectangles, Ovals) faster then using images? I would think so.....
Is using an array for 10 variables faster then actually assigning 10 different variables? Also would think so....
Sorry I have so many questions...
Well so far I REALLY like Java. More then any other programming language for that matter. Plus it is cross-platform so that is another bonus. :-D
Ok here is what I figured out.
Making multiple threads is not necessary unless you have a LOT of code.
I found out that OOP is necessary in some cases but not all. (Like in games)
I found out that using built in shapes is a LOT faster then images but in some cases you HAVE to use images.
Making an Array for ten values is a LOT faster then making ten separate variables.
Is this correct???
-
October 25th, 2009, 01:17 PM
#3
Re: Several more questions. :-/
threads make sense only if you have long task that is cpu or other resource intensive, doesn't matter of the size of code. usually it makes sense to put UI in one thread and long actions in others.
java is not C you can't optimize memory storage using 'better' stored variables.
java is OOP, it is up to you how you are going to use it. if multiple people are developing, then proper use of OOP yields great benefits
-
October 25th, 2009, 01:47 PM
#4
Re: Several more questions. :-/
 Originally Posted by postmortem
java is OOP, it is up to you how you are going to use it. if multiple people are developing, then proper use of OOP yields great benefits
Yeah but like if you were making a pong replica you won't need OOP However if you were making the worlds next RPG then OOP would play a VERY important factor in your game. hahaha
-
October 25th, 2009, 05:48 PM
#5
Re: Several more questions. :-/
 Originally Posted by David2010
Yeah but like if you were making a pong replica you won't need OOP However if you were making the worlds next RPG then OOP would play a VERY important factor in your game. hahaha
So explain how you would write a Java pong replica without using OOP. Strangely, you don't sound like someone who's used 6 languages and worked with Java a GOOD while... 
If I had eight hours to chop down a tree, I would spend 6 hours sharpening an axe...
Anon.
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
October 25th, 2009, 09:19 PM
#6
Re: Several more questions. :-/
------
If you are satisfied with the responses, add to the user's rep!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|