为什么我们在java中使用静态类? [英] Why we use static class in java ?

查看:338
本文介绍了为什么我们在java中使用静态类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Frnds



为什么我们在java中使用静态类。

我们可以创建主类或类作为静态



我的尝试:



i了解静态类。我们不能创建这个对象,静态可以是变量和方法。



我去采访他们问我为什么我们使用静态类。使用这个我们可以做什么

Hi Frnds

Why we use static class in java .
can we create main class or class as static

What I have tried:

i know about static class . we cant not create object of this and static can be variable and methods .

i went for the interview they asked me why we used static class . using this what we can do achieve

推荐答案

请阅读: Java中的静态类 - GeeksforGeeks [ ^ ]和: Java静态类:Java静态类教程 [ ^ ]
Please, read this: Static class in Java - GeeksforGeeks[^] and this: Java Static Class: A Tutorial on Static Classes in Java[^]


这篇关于为什么我们在java中使用静态类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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