小编Jam*_*mes的帖子

Java空指针异常 - 不明白为什么

MovieList.java中main方法的运行时错误.

我不确定我的程序设计是否从根本上说非常好,但我想知道它崩溃的原因.提前致谢.

package javaPractical.week3;

import javax.swing.*;

public class Movie {
    //private attributes
    private String title;
    private String movieURL;
    private String year;
    private String genre;
    private String actor;

    // constructor
    Movie(String t, String u, String y, String g, String a) {
        this.title = t;
        this.movieURL = u;
        this.year = y;
        this.genre = g;
        this.actor = a;

    }
    //getters and setters
    public void setTitle(String t) {
        this.title = t;
    }

    public String getTitle() {
        return this.title;
    }

    public void set_url(String a) { …
Run Code Online (Sandbox Code Playgroud)

java null exception nullpointerexception

2
推荐指数
1
解决办法
3417
查看次数

标签 统计

exception ×1

java ×1

null ×1

nullpointerexception ×1