달력

72025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31


// 다중 상속이 된다.

interface Inter1
{
 int a = 10;
 public int getA();
}

interface Inter2
{
 int b = 20;
 public int getB();
}

class InterEx2 implements Inter1, Inter2
{
 public int getA()
 {
  return a;
 }

 public int getB()
 {
  return b;
 }

 public static void main( String[] args )
 {
  InterEx2 ie = new InterEx2();
  System.out.println( "a : " + ie.getA() );
  System.out.println( "b : " + ie.getB() );
 }
}

Posted by cdprkr2077
|