CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2009
    Posts
    100

    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.

  2. #2
    Join Date
    Jun 2009
    Posts
    100

    Re: Several more questions. :-/

    Quote Originally Posted by David2010 View Post
    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???

  3. #3
    Join Date
    Oct 2008
    Posts
    77

    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

  4. #4
    Join Date
    Jun 2009
    Posts
    100

    Re: Several more questions. :-/

    Quote Originally Posted by postmortem View Post

    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

  5. #5
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Several more questions. :-/

    Quote Originally Posted by David2010 View Post
    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.

  6. #6
    Join Date
    Apr 2007
    Posts
    425

    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
  •  





Click Here to Expand Forum to Full Width

Featured