public class Output
{
static void main(int a, int b)
{
int S=0;
S+=(a>o)?a:-b;
S-= (a<o)?-a+b;
System.out.println(s);
}
}
When:
a. a=-5 and b=-6
b. a=5 and b=6
Pls say the answer sincerely
Answers
Answered by
0
Answer:
class A {
public int i;
private int j;
}
class B extends A {
void display()
{
super.j = super.i + 1;
System.out.println(super.i + " " + super.j);
}
}
class inheritance {
public static void main(String args[])
{
B obj = new B();
obj.i = 1;
obj.j = 2;
obj.display();
}
}
a) 2 2
b) 3 3
c) Runtime Error
d) Compilation Error
Answer: d
Answered by
0
Answer:
ans) It will not show the output.
Explanation:
Since, 'public' keyword is not used before static keyword.
So, it will return the following error
error: 'main' method is not declared 'public static'
Similar questions