Which is better C++/JAVA?

Could someone give me an explaination as to why
C++/OpenGL is better than Java when trying to program 3D
objects?? Also could you plsss tell me the pros and cons
for each one?? Though i was thinking of using JAVA.
thx

You can't really say one is 'better' than the other. As far as 3d programming goes, it's likely you could achieve faster, smoother 3d programming (comparable to current PC games) with C++ but you at the sacrifce of much time and greater knowledge. Although Java3d is arguably not as fast as C++ it has been optimized for speed. If you're writing applications on your own then I'd strongly recommend Java. It's easier to pick up and will give you a good starting ground if you ever decide to take up C++. Also, with j3d you can write one program and (in theory ) it should be able to run w/ either DirectX or OpenGL.

Similar Messages

  • Which is better? JDO or Java Persistance API?

    Hi folks
    I'm trying to build an app on Google's cloud service.
    Looking into this ( [http://code.google.com/appengine/docs/java/overview.html|http://code.google.com/appengine/docs/java/overview.html]), it tells me that for java projects there are 2 possibilities for persistance - JDO , and Java Persistance. Does anyone have any advice on which is better and/or easier? Also, if anyone has a small example they could post, that would be very useful too.
    this isn't exactly a JDBC question, and maybe this should be posted somewhere else? If so please tell me where I should be asking this question.
    Thanks!
    -Tom

    I personally find Java Persistence to be easy to use and it works just fine.
    I can't say if you would agree. You'll just have to judge that for yourself, which means: put some effort into trying it out. I'd start by not requesting small examples in a forum, but by actually looking for them yourself using your search engine of choice.

  • Which is better ? Toplink Java objects or Toplink Entities ?

    Hi
    We are planing to use Toplink JPA that comes with JDeveloper 11g preview release
    I have a question here!
    I would like to get clarified which is better to use :
    1. Toplink Java Objects from Tables ,
    2.Toplink Entities from Tables
    Could you suggest the best approach, and pros and cons of both the approaches?
    Thanking you ,
    Samba

    Samba,
    Ultimately both are using the same TopLink runtime. In the case of Entities you are using JPA and Java Objects you are using TopLink native API and metadata.
    Going forward I would recommend JPA with TopLink extensions as required.
    Doug

  • Which database is better with JAVA ?

    Which database is better with JAVA Oracle of MySQL ?

    your question is too general but i prefer oracle for large projectsAs long as somebody else is paying the license fee.
    and mysql for small projects.And this contributes what new information to the discussion?
    >
    you might also consider using postgresql. also an
    open-source but much better than mysql :-)Much better, indeed. Thanks for the second.
    you might also consider the use of
    object-relational-mapping (ex.hibernate)
    for your database and application so your application
    written
    on java wont be much dependent on the database :-)Your application won't be any less dependent on the database. It will make it possible to switch databases just by changing the Hibernate dialect.
    I would not recommend Hibernate to someone who has to ask this question.
    %

  • Which is better to use: BEx query or Web Application as an iView in portal?

    Hi gurus!
    Are there any experienced opinions, which is better - publish a BEx query in portal or publish a BEx Web Application in portal? Is it easier to alter the layout attributes etc. if I create a BEx Web Application first before publishing?
    What is the way of fixing for example filter item height if I publish BEx query in portal - is there a Web Application that it uses anyhow which I can fix? Or can I use in that case iView -properties in portal?
    Thankful for advice
    Sari

    ok, means i can use jsp:useBean tag for all my
    classes that are not actually bean. so it will be
    instantiated at run time and provide efficiency .No. Jsp:useBean is used for java bean components.
    >
    but when should i use import statement in my jsp and
    it happen at translation time so will it create any
    type of burden for my code if i import multiple
    classes.For non-java beans, you need to import the classes, period.
    It's not a burden, it's a necessity.

  • Which is better for servers, Apache or Tomcat?

    Which is better for servers, Apache or Tomcat?

    For some reason that link I gave you isn't working right now, but it was today, weird. I would get Tomcat simple because sun uses it in its examples and recommends it. Here's sun's link then, it's probably more useful anyway. http://java.sun.com/products/jsp/

  • Which is better sockets/socketchannel why

    which is better java.io.Socket / java.nio.channel.SocketChannel

    Better for what? They both work. Sockets are simple but only support blocking operations. SocketChannels are about ten times as complex to use but they support non-blocking and multiplexed I/O and also various types of direct and mapped buffering so they can also imply less data movement.

  • Which is better for newbies?

    Which is better for newbies, Jgrasp or Netbeans? I need something that explains errors more thoroughly than Jgrasp.

    Here's my code with 3 errors. Now bear in mind that my program has compiled completely and ran correctly up to this method. All I'm trying to do with this method is get the average of all grades in a multi-array. I researched and found some code that was similar to what I needed to do but it's not working out yet. All other methods in my program work perfectly but I can't get this one to compile.
    public double getMean(int allGrades[][])
              int total = 0;
              for (int grade : allGrades)
              total += grade;
         System.out.println("Total is "+getMean(grades));     
              return total/allGrades.length;
    } // end class GradeBookGradebook.java:100: illegal start of type
              return total/allGrades.length;
              ^
    Gradebook.java:100: <identifier> expected
              return total/allGrades.length;
              ^
    Gradebook.java:100: <identifier> expected
              return total/allGrades.length;
              ^
    3 errors

  • Coding Preference ..Which is better for memory?

    Hey all,
    Javas garbage collection is sweet. However, I was reading somewhere that setting some objects to null after I'm done with them will actually help.
    (help what .. I'm not sure.. my guess is memory used by the JVM)
    Thus I have two ways to do the same thing and I'd like to hear peoples comments on which is "better" ... or will yield faster performance.
    Task: I have a Vector of Strings (called paths) that hold absolute file paths. (Don't ask why I didn't use a String[]) I'd like to check and see if they exist, and if not, create them... I'll use the createNewFile() method for that.
    Method A -- Here I'll reuse that File object
    public void myMethod()throws Exception{
    File file = null;
    for(int i = 0; i < paths.size(); i++){
      file = new File(paths.get(i).toString());
      boolean made  = file.createNewFile();
      if(made){doSomething();}
    file = null;
    }Method B -- Here I'll use um... "dynamically made" ones that I won't eventually be set back to null
    public void myMethod()throws Exception{
    for(int i = 0; i < paths.size(); i++){
      boolean made  = (new File(paths.get(i).toString())).createNewFile();
      if(made){doSomething();}
    }So when the code eventually exists myMethod, the object "file" will be out of scope and trashed.... correct? If thats the case, then would there be any other differences between the two implementations?
    Thanks

    There's no real difference between the two. Choose the style you prefer,
    although in the first one I'd lose the "file = null" statement since that
    variable is about to disappear, and I'm move the definition into the loop
    -- always give variables as small a scope as possible, mainly to
    keep the logic simple:
    public void myMethod()throws Exception{
        for(int i = 0; i < paths.size(); i++){
            File file= new File(paths.get(i).toString());
            boolean made  = file.createNewFile();
             if(made){doSomething();}
    }

  • Which is better, Double Buffering 1, or Double Buffering 2??

    Hi,
    I came across a book that uses a completely different approach to double buffering. I use this method:
    private Graphics dbg;
    private Image dbImage;
    public void update() {
      if (dbImage == null) {
        dbImage = createImage(this.getSize().width, this.getSize().height);
        dbg = dbImage.getGraphics();
      dbg.setColor(this.getBackground());
      dbg.fillRect(0, 0, this.getSize().width, this.getSize().height);
      dbg.setColor(this.getForeground());
      paint(dbg);
      g.drawImage(dbImage, 0, 0, this);
    }that was my method for double buffering, and this is the books method:
    import java.awt.*;
    public class DB extends Canvas {
         private Image[] backing = new Image[2];
         private int imageToDraw = 0;
         private int imageNotDraw = 1;
         public void update(Graphics g) {
              paint(g);
         public synchronized void paint(Graphics g) {
              g.drawImage(backing[imageToDraw], 0, 0, this);
         public void addNotify() {
              super.addNotify();
              backing[0] = createImage(400, 400);
              backing[1] = createImage(400, 400);
              setSize(400, 400);
              new Thread(
                   new Runnable() {
                        private int direction = 1;
                        private int position = 0;
                        public void run() {
                             while (true) {
                                  try {
                                       Thread.sleep(10);
                                  }catch (InterruptedException ex) {
                                  Graphics g = backing[imageNotDraw].getGraphics();
                                  g.clearRect(0, 0, 400, 400);
                                                    g.setColor(Color.black);
                                  g.drawOval(position, 200 - position, 400 - (2 * position), 72 * position);
                                  synchronized (DB.this) {
                                       int temp = imageNotDraw;
                                       imageNotDraw = imageToDraw;
                                       imageToDraw = temp;
                                  position += direction;
                                  if (position > 199) {
                                       direction = -1;
                                  }else if (position < 1) {
                                       direction = 1;
                                  repaint();
              ).start();
         public static void main(String args[]) {
              Frame f = new Frame("Double Buffering");
              f.add(new DB(), BorderLayout.CENTER);
              f.pack();
              f.show();
    }which is better? I noticed smoother animation with the later method.
    Is there no difference? Or is it just a figment of my imagination??

    To be fair if you download an applet all the class files are stored in your .jpi_cache, and depending on how that game requests its graphics sometimes they are stored there to, so really if you have to download an applet game twice, blame the programmer (I've probably got that dead wrong :B ).
    But, what's wrong with Jars. They offer so much more.
    No offence meant by this Malohkan but if you can't organize your downloaded files the internet must really be a landmine for you :)
    Personally I'd be happy if I never seen another applet again, it seems java is tied to this legacy, and to the average computer user it seems that is all java is capable of.
    Admitidly there are some very funky applets out here using lots of way over my head funky pixel tricks, but they would look so much better running full screen and offline.

  • Which is better? Code comparsion of performance and style

    Recently I run into a discussion over a small piece of code. Could help me which is better, either in performance or coding style? The code is not complete, the question is the use of local cancellationNumber variable.
    public String cancelAction(/**/) {
    /* some code */
            String cancellationNumber = result.getCancellationNumber();
            if (empty(cancellationNumber)) {
                throw new Exception("Did not receive a cancellation number!");
            return cancellationNumber;
        }or
    public String cancelAction(/**/) {
    /* some code */
            if (empty(result.getCancellationNumber()) {
                throw new Exception("Did not receive a cancellation number!");
            return result.getCancellationNumber();
        }

    Yes, I know profiling can be misleading, also compiler optimization adds to the picture. However seeing the numbers differentially, I think there is still some information, which is faster, even if taking it completely out scope. I didn't paste the code, because it's so trivial. I run the two methods in a loop with same arguments.
    With increased loop count, the difference is 6-7%, cancelActionWithLocal being faster. But this can be pointless, I know.
    package org.helloprofile;
    import static org.helloprofile.Util.empty;
    import java.util.Locale;
    public class CUT {
        public String cancelActionWithoutLocal(Locale locale, String email, long itineraryId, String confirmationId) throws Exception {
            Result result = new Result();
            if (empty(result.getCancellationNumber())) {
                throw new Exception("Did not receive a cancellation number!");
            return result.getCancellationNumber();
        public String cancelActionWithLocal(Locale locale, String email, long actionId, String confirmationId) throws Exception {
            Result result = new Result();
            String cancellationNumber = result.getCancellationNumber();
            if (empty(cancellationNumber)) {
                throw new Exception("Did not receive a cancellation number!");
            return cancellationNumber;
    }Thanks for the comments!

  • Which is better - Applet or JSP?

    I am creating an appilcation. It basically will use a database to allow users to enter new records or edit existing ones. I'm taking over this project from another person, who started it as an applet but didn't get too far. I'm looking at what is better - applet or plain jsp pages. What are the pluses and minues of each?

    Which is better, apples or oranges?
    The are probably no disadvantages to JSP except that you need a JSP server. The main disadvantage to applets is you almost certainly need the users to have the Java Plugin to run it. If they don't, they have to get and install it. JSP doesn't need any of that.

  • Which is better ODBC or JDBC

    dear all,
    after upgrading most of our servers from cf5 to CFMX7.1, it
    is now time to start working on some performance strategies for the
    upgrades. currently we went with the ODBC connector in CFMX for
    testing purposes. one of our server will occasionally lose the odbc
    and we have to reboot the server to get it rolling again.
    this leads up to the question of which is better for
    performace (speed, less process inducive) and realiability. ODBC or
    JDBC with CFMX7.1
    thanx
    sean

    I would concur ... as CF is java based, it will run better
    with JDBC rather than having to interpret a bridge between the 2.
    There are a couple of very remote instances where ODBC may be
    required, but you will have much better results with JDBC.

  • Which is better,websphere or weblogic?

    Our company want to establish a network serving for PC ,wap ,pda and so on using j2ee.but I don��t know which is better Between Websphere application server and Weblogic.
    Who can tell me in detail?

    Something to start with:
    WebSphere
    1. WebSphere covers more platforms.
    2. WebSphere has a better supportline (IBM know this stuff)
    3. Having DB2 as a database, you might want to use WebSphere, since it has a lots of advantages of using both the database and AppServer from the same Vendor.
    WebLogic:
    1. WebLogic is a more possisioned appserver
    2. I 'believe' weblogic is more up to date with java versions and technologies
    regards
    Andreas

  • Xerces or JDOM which is better?

    hi all
    i would like to ask for some opinions.
    Xerces and JDOM which is better?
    thanks!

    This dude is right. JDOM6 is the bomb.
    here is a little present:
    import java.io.*;
    import java.io.File;
    import java.util.List;
    import java.util.Iterator;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.JDOMException;
    import org.jdom.adapters.*;
    import org.jdom.adapters.CrimsonDOMAdapter;
    import org.jdom.input.DOMBuilder;
    import org.jdom.output.XMLOutputter;
    public class xmltest
    // Global value so it can be ref'd by the tree-adapter
    public static Document document;
    public static DOMBuilder builder;
    public static String product_name, description, price;
    public static Double checkPrice;
    public static void readDoc()throws IOException, JDOMException
    builder = new DOMBuilder();
    try {
    FileInputStream in = new FileInputStream(new File("settings.xml"));
    document = builder.build(in);
    in.close();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    public static void listProducts()throws IOException, JDOMException
    readDoc();
    Element root = document.getRootElement();
    List products = root.getChildren();
    Iterator productsIterator = products.iterator();
    System.out.println("Currently " + products.size() + " products.");
    while(productsIterator.hasNext()){
    Element productElement = (Element)productsIterator.next();
    List product = productElement.getChildren();
    System.out.println(productElement.getTextTrim());
    Iterator productIterator = product.iterator();
    while(productIterator.hasNext()){
    Element attElement = (Element)productIterator.next();
    System.out.println(attElement.getName() + " : " + attElement.getText());
    public static void removeProduct(String productName)throws IOException, JDOMException
    readDoc();
    Element root = document.getRootElement();
    List products = root.getChildren();
    Iterator productsIterator = products.iterator();
    root.removeChildren();
    while(productsIterator.hasNext()){
    Element tempElement = (Element)productsIterator.next();
    if(!tempElement.getTextTrim().equals(productName)){
    root.addContent(tempElement);
    document.setRootElement(root);
    saveChanges();
    public static void addProduct(String product_name, String description, String price)throws IOException, JDOMException
    readDoc();
    Element product = new Element("product");
    Element root = document.getRootElement();
    product.addContent(product_name);
    product.addContent(new Element("description").addContent(description));
    product.addContent(new Element("price").addContent(price).addAttribute("currency", "US"));
    root.addContent(product);
    saveChanges();
    public static void saveChanges(){
    try {
    XMLOutputter outputter = new XMLOutputter();
    FileWriter writer = new FileWriter("settings.xml");
    outputter.output(document, writer);
    writer.close();
    } catch (java.io.IOException e) {
    e.printStackTrace();
    public static void main(String argv[])throws IOException, JDOMException
    int selection;
    for(;;){
    System.out.println("1. Add a product\n2. Remove a product\n3. View products\n4. exit program");
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    try{
    selection = Integer.parseInt(in.readLine());
    switch(selection){
    case 1:
    System.out.println("Enter product name.");
    product_name = in.readLine();
    System.out.println("Enter product description.");
    description = in.readLine();
    System.out.println("Enter product price.");
    price = in.readLine();
    try{
    checkPrice = new Double(price);
    addProduct(product_name, description, price);
    }catch(Exception e){
    System.out.println("The product's price must be a numeric value.");
    break;
    case 2:
    System.out.println("Enter product name to remove.");
    product_name = in.readLine();
    removeProduct(product_name);
    break;
    case 3:
    listProducts();
    break;
    case 4:
    System.exit(1);
    break;
    default:
    System.out.println("The number you have typed is incompatible with the menu.");
    break;
    }catch(Exception e){
    System.out.println("Please type in a number that maches the menu.");
    enjoy....

Maybe you are looking for

  • Voice memos are not sychronizing

    all of the sudden my voice memos don't synch anymore. they are shown in the list on the phone but are synched to my computer (Windows 7) Anybody know why and what to do ?

  • How to delete columns in table control

    hi 1) I have creted a table control with five columns now i want to delted the tow of the five coluent pls let me know how to delete it 1) also i am useing a module pool programming (code if needed i will paste) in that the requirment is to select da

  • Dreamweaver CS3 to CS4 Changes

    Changes in Dreamwever CS3 to CS4 Creating a text box over a photo. I have been using a technique in CS3 learned from "totaltraining.com" I could take a photo into photoshop and slice it into areas where I want to create a text block and use the photo

  • Can somebody explain to me how java and xml are related?

    Hi guys im new to java and xml.Been reading a lot regarding java and don't seem to have a problem with it... the problem is the xml part...im doing a simple GUI project using swing(online store) and i have to convert it to xml I have absolutely NO ID

  • How to re-install Photoshop CS5? [was: crash computer with older version (dell laptop)]

    My notebook had a crash and we had to reinstall it. it is a dell machine, winddows 7, Photoshop CS5 this was its summary befoire crash: Adobe Photoshop Version: 12.0 (12.0x20100407 [20100407.r.1103 2010/04/07:14:00:00 cutoff; r branch]) x64 Operating