# Thread: finding max and min with inheritance with two input integer

1. Member
Join Date
Nov 2009
Posts
2
Rep Power
0

## finding max and min with inheritance with two input integer

somebody help me this one pls. i m so new to java and don't hav idea for that.
pls help.

2. Member
Join Date
Apr 2009
Location
Pretoria, Gauteng, South Africa
Posts
43
Rep Power
0
I dont think your question is descriptive enough. where is the code you tried writing?

3. Member
Join Date
Nov 2009
Posts
2
Rep Power
0

class abc extends efg{

public int max(int a,int b){

int c=0;

if (a>b)
c=a;
else
c=b;

System.out.println("Max " + c);
return c;
}

public static void main(String args[]) {
int d=90;
int e=80;
abc v=new abc();
v.min();
v.max(d,e);

}
}

class efg{

public int min() {
int a= 1;
int b=30;
int c=0;

if (a<b)
c=a;
else
c=b;

System.out.println("Min " + c);
return c;
}
}

Java Code:
```public class Test {
Test(int[] ints) {
for(int i = 0; i < ints.length; i++) {
System.out.printf("ints[%d] = %d%n", i, ints[i]);
}
}

public static void main(String[] args) {
int[] n = new int[0];
if(args.length > 0) {
n = new int[args.length];
for(int i = 0; i < n.length; i++) {
n[i] = Integer.parseInt(args[i]);
}
}
new Test(n);
}
}```
Java Code:
```C:\jexp>java Test 1 2 3 4 5
ints[0] = 1
ints[1] = 2
ints[2] = 3
ints[3] = 4
ints[4] = 5```

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•