Results 1 to 7 of 7
  1. #1
    Arukas is offline Member
    Join Date
    Feb 2012
    Posts
    9
    Rep Power
    0

    Default Java's being more secure than C++

    I'm very familiar with C++, and I have just started learning Java. The book I had is claiming that Java is more secure than C++. My question is: Are they claiming Java is more secure because it runs on a virtual machine?

    -Thanks

  2. #2
    christopherx is offline Member
    Join Date
    Oct 2011
    Posts
    92
    Rep Power
    0

    Default Re: Java's being more secure than C++

    Java programs have constraints on them. For example, Java programs won't compile unless you declare that a certain type of exception will be thrown. C++ allows you too compile more volitile programs. Also, in Java you can not reference memory locations that don't belong to your program. In C++, you can! It just means Java forces you too take extra precautions to make sure it doesn't do any damage. C++ gives you more freedom, but also comes with more risk as a result!

  3. #3
    Arukas is offline Member
    Join Date
    Feb 2012
    Posts
    9
    Rep Power
    0

    Default Re: Java's being more secure than C++

    So, from what you saying, Java isn't more secure than C++. Java just uses safety features that require a certain level of security features?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Java's being more secure than C++

    Quote Originally Posted by Arukas View Post
    So, from what you saying, Java isn't more secure than C++. Java just uses safety features that require a certain level of security features?
    We're arguing about the number of angels that can dance on the head of a pin here. No one can say this is "more secure" than that as it is a gross over-generalization and really makes no sense. Secure in what sense? Based on what metric?

  5. #5
    Arukas is offline Member
    Join Date
    Feb 2012
    Posts
    9
    Rep Power
    0

    Default Re: Java's being more secure than C++

    Quote Originally Posted by Fubarable View Post
    We're arguing about the number of angels that can dance on the head of a pin here. No one can say this is "more secure" than that as it is a gross over-generalization and really makes no sense. Secure in what sense? Based on what metric?
    I'm just reading a Java book, and it makes the claim that Java is more secure than C++. My opinion is its a baseless claim. I think the book is claiming the security benefits of a virtual machine for Java's own.

    My understanding, when considering C++ vs Java, the trade-off is speed vs portability.

    I'm spending this weekend, learning Java. I have experience in C++ programming. The point of my question was to see if I'm mode of thinking is correct. Also, I wanted to try the forums out as I will have many more questions once I start programming in Java. I learning it one thing, but using it a completely different animal. I just want to make sure I use it to its fullest potential.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Java's being more secure than C++

    Quote Originally Posted by Arukas View Post
    I'm just reading a Java book, and it makes the claim that Java is more secure than C++. My opinion is its a baseless claim. I think the book is claiming the security benefits of a virtual machine for Java's own.
    It's an overly generalized unprovable nonsense statement. I would just move on if I were you.

    My understanding, when considering C++ vs Java, the trade-off is speed vs portability.
    Not quite. Java's "HotSpot" JVM is able to optimize code pretty well, so that while the first part might have once been true, it can not be made as a blanket statement. The second part of the statement also may have some holes. Sure you can create small programs that run on many different platforms, but once you start adding specialized libraries or services, portability becomes more difficult to maintain. I would say that Java is better adapted towards creating applications that may be able to run on multiple platforms but it is ill-suited towards making applications that need a close association with the operating system since it has been constructed to be as OS-agnostic as possible.

    I'm spending this weekend, learning Java. I have experience in C++ programming. The point of my question was to see if I'm mode of thinking is correct. Also, I wanted to try the forums out as I will have many more questions once I start programming in Java. I learning it one thing, but using it a completely different animal. I just want to make sure I use it to its fullest potential.
    Welcome to Java and welcome to the Java-Forums.org!

  7. #7
    Arukas is offline Member
    Join Date
    Feb 2012
    Posts
    9
    Rep Power
    0

Similar Threads

  1. Secure java code allong with the setup of application
    By Annie George in forum NetBeans
    Replies: 0
    Last Post: 01-08-2011, 10:57 AM
  2. Why java is very secure
    By siva_vs_siva in forum New To Java
    Replies: 11
    Last Post: 09-08-2010, 12:57 PM
  3. How Java is so secure than other?
    By makpandian in forum New To Java
    Replies: 4
    Last Post: 06-26-2009, 05:22 AM
  4. data loss in the secure file transfer using java
    By antony75 in forum Networking
    Replies: 4
    Last Post: 02-09-2009, 07:56 AM
  5. Replies: 1
    Last Post: 08-07-2007, 07:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •