---
title: "改一行，让下面的程序输出 O noes"
author: "googya"
date: "2011-04-13T11:40:37Z"
tags: ["Java"]
categories: ["编程语言"]
slug: "o-noes"
draft: false
lastmod: "2011-04-13T11:40:37Z"
id: 1001168
url: "https://googya.iteye.com/blog/1001168"
---

下面是个不完整的代码，story的参数的类型没有标明，指定o的类型，使下面的程序能运行...........


```java
public class Story {
    public static void main(String[] args) {
        Object o = null;
        story(o);
    }

    private static void story(类型  o) {
        if (o != null)
            System.out.println("O noes!");
    }
}
```