hackerearth questionssiemens

Solutions on MaxInterview for hackerearth questionssiemens by the best coders in the world

showing results for - "hackerearth questionssiemens"
Adrianne
13 Jan 2018
1public class hackerearth
2{
3    public static void main(String[] args)
4    {
5        hack2 h = new hack2();
6        System.out.println(h.hack_method1(0));
7    }
8}
9class hack1
10{
11    private int hack_method1(int hack)
12    {
13        return hack++;
14    }
15     
16    public int hack_method2(int hack)
17    {
18      
19        System.out.println(hack);
20        return hack_method1(hack++);
21    }
22}
23 
24
25class hack2 extends hack1
26{
27    int hack_method1(int hack)
28    {
29        return hack_method2(++hack);
30    }
31}