可以在不创建对象的情况下调用方法..... [英] can call a method with out creating an object.....

查看:128
本文介绍了可以在不创建对象的情况下调用方法.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在不创建对象的情况下调用方法.....

can call a method with out creating an object.....

推荐答案

实际上,在面向对象的编程中,必须使用对象来调用函数,如果用静态声明函数,则还有另一种使用静态关键字调用方法的方法,我们可以直接调用而无需对象
Actually in object oriented programming one have to use the object for calling the function,there is an another way to call a method by using static key word if the function is declared with static we can call directly without an object


Static可以在不创建实例的情况下调用方法.
请参见此处.
Static methods can be called without creating instances.
See here.


这篇关于可以在不创建对象的情况下调用方法.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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