문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자. 문서의 원본을 보거나 복사할 수 있습니다. ==개요== ;HR자바 Java Inheritance II * https://www.hackerrank.com/challenges/java-inheritance-2/problem {{HR자바 헤더}} {{HR자바 Object Oriented Programming}} |} ---- <syntaxhighlight lang='java'> import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; </syntaxhighlight> <syntaxhighlight lang='java'> //Write your code here class Arithmetic { int add(int a, int b) { return a+b; } } class Adder extends Arithmetic {} </syntaxhighlight> <syntaxhighlight lang='java'> public class Solution{ public static void main(String []args){ // Create a new Adder object Adder a = new Adder(); // Print the name of the superclass on a new line System.out.println("My superclass is: " + a.getClass().getSuperclass().getName()); // Print the result of 3 calls to Adder's `add(int,int)` method as 3 space-separated integers: System.out.print(a.add(10,32) + " " + a.add(10,3) + " " + a.add(10,10) + "\n"); } } </syntaxhighlight> 이 문서에서 사용한 틀: 틀:Ed (원본 보기) 틀:HR자바 Object Oriented Programming (원본 보기) 틀:HR자바 헤더 (원본 보기) 틀:언어아이콘 (원본 보기) 틀:언어이미지 (원본 보기) HR자바 Java Inheritance II 문서로 돌아갑니다.