java.io 中最常用的模式是什么? [英] What is the most used pattern in java.io?

查看:25
本文介绍了java.io 中最常用的模式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在求职面试时被问到这个问题,我无法回答.那么,java.io 中最常用的模式是什么,又是如何使用的呢?常见的 Java 库中使用的其他模式是什么?

I was asked this question recently during my job interview, and I couldn't answer it. So, what is the most used pattern in java.io and how is it used? What are other patterns used in common java libraries?

推荐答案

我猜他们想了解 装饰器模式,可以在各种流、读取器和写入器中找到.

I guess they wanted to hear about the Decorator pattern which can be found in the various Streams, Readers and Writers.

其他模式(小选):

  • Observer pattern in the swing libraries
  • Factory pattern in the javax.xml.parsers packages
  • Iterator pattern, used in collections

我很确定人们可以找到此维基百科中列出的几乎所有模式的示例Java SDK 中的页面.

I'm pretty sure that one can find examples for almost all patterns listed on this wikipedia page in the Java SDK.

这篇关于java.io 中最常用的模式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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