java 修得度問題

1)Javaのプロセスに対してSIGQUITシグナルを送った時の動作を説明してください。


2)public static void main 関数を実装し
  Bをインスタンス化し、標準出力に "20-test" と出力される様にせよ

package sample;
class A<A>
{
    class B<B>
    {
        public void out()
        {
            System.out.print(a);
            System.out.print("-");
            System.out.println(b);
        }

        private A a;
        private B b;
    }

    /**
     * @param args
     */
    public static void main(final String... args)
    {
    }
}

3)public static void main を 実行した結果
  hoge
  fuga
  hogehoge
  になるように enum B の コンストラクタは修正せず 実装せよ

package sample;

class A
{
    static interface AA
    {
        String value();
    }

    enum B implements AA
    {
        A,

        B,

        C;

        private B()
        {
        }
    }

    /**
     * 
     * 
     * @param args
     */
    public static void main(final String... args)
    {
        System.out.println(B.A.value());
        System.out.println(B.B.value());
        System.out.println(B.C.value());
    }
}





4)本プログラムを実行した結果を示せ

package sample;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@B(C.class)
public class A
{
    /**
     * @param args
     * @throws Exception
     */
    public static void main(final String... args) throws Exception
    {
        System.out.println(C.class.getAnnotation(B.class)
                .value()
                .getAnnotation(B.class)
                .value()
                .newInstance()
                .value());
    }

    /**
     * @return label
     */
    public String label()
    {
        return "fuga";
    }

    /**
     * @return value
     * @throws Exception
     */
    public String value() throws Exception
    {
        return this.getClass()
                .getAnnotation(B.class)
                .value()
                .newInstance()
                .getClass()
                .getAnnotation(B.class)
                .value()
                .newInstance()
                .value();
    }
}

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@interface B
{
    String lable() default "hogexhoge";

    Class<? extends A> value() default A.class;
}

@B(D.class)
class C extends A
{
    /**
     * @return label
     */
    @Override
    public String label()
    {
        return "hogahoga";
    }

    /**
     * @return value
     */
    @Override
    public String value()
    {
        return "fugafuga";
    }
}

@B
class D extends A
{
}