0
Why Java is more secure
Why Java is more secure
2 ответов
+ 1
Compared to lower level languages like c and c++, java does a lot to control memory for you.
C and cpp use pointers. These pointers can point ANYWHERE in memory. If you misuse them it can point and edit the wrong memory. Java does not support pointers so you do not need to worry about memory.
Java also does boundry checks on arrays while c and maybe cpp do not.
In java:
int array[] = {1};
array[-1];
This would cause an array out if bounds error...
In c/cpp(same code):
int array[] = {1};
array[-1];
This still works and would grab some junk data.
Java is a lot more strict and therefore secure.
+ 1
according to me, Java runs in Java virtual machine not directly in os and C and CPP directly runs inside OS so Java is more secure