lundi 1 juin 2015

In given code which exception that will occur in the following program and how will u fix it?

What is the exception that will occur in the following program and how will might I fix the problem?

package com.quest.interview;

public final class Singleton {

    private static final Singleton sinleton_inst= new Singleton();
    public static final Boolean have_Instance = true;
    private final Boolean inst_Avail=have_Instance;

    private Singleton(){};

    public final Boolean isInstAvail() {
        return inst_Avail;
    }

    public static void main(String[] args) {
        System.out.println(sinleton_inst.isInstAvail() ? "Instance is there." : "No instance");
    }
}

Aucun commentaire:

Enregistrer un commentaire