关于指针 [英] About pointers

查看:71
本文介绍了关于指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

java中有指针概念吗?如果是这样怎么用?如果不是为什么?

Hello friends,
Is pointer concept is there in java? If so how to use? if not why?

推荐答案


你好朋友,

指针概念在那里java吗?如果是这样怎么用?如果不是为什么?
Hello friends,
Is pointer concept is there in java? If so how to use? if not why?



指针不在java上。


语言设计者决定将内存管理抽象到Java的更高级别而不是C.这样做的原因是使用指针和其他低级内存管理技术很容易出错。这些错误可能导致错误。难以阅读的代码,浪费系统资源的内存泄漏以及安全问题。

Pointer is not on java.

The language designers decided to abstract memory management to a higher level in Java than in C. The reason for this is that it is easy to make mistakes using pointers and other lower level memory management techniques. These mistakes can lead to bugs. hard to read code, memory leaks that waste system resources, and security issues.


Java确实有指针。当你声明一个没有初始化它的对象时,例如String str;,你实际上得到了一个指针。使用new返回一个指针,以便在将大对象传递给函数时帮助堆栈空间。 通过引用传递。 Java用于将对象传递给函数的方法?它是通过指针引擎盖下。 Java隐藏了所有这些指针功能,以避免详细内存管理的陷阱。
Java actually does have pointers. When you declare an object without initializing it, eg String str;, you''re actually getting a pointer. Using new returns a pointer as well to help with stack space when passing large objects to functions. The "pass by reference" method that Java uses to pass objects to functions? It''s "pass by pointer" under the hood. Java hides all this pointer functionality to avoid the pitfalls of detailed memory management.



指针不在java上。
Pointer is not on java.



Java充满了指针(每个对象实际上都是一个指向对象状态(值)的指针)。

Java只是没有''有指针算术但指针遍布整个地方。


亲切的问候,


Jos

Java is full of pointers (every object is actually a pointer to an object state (value)).
Java just doesn''t have pointer arithmetic but pointers are all over the place.

kind regards,

Jos


这篇关于关于指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆