hello everybody
can anyone of u please explain me the answers for these questions.I am actually very confused.
code:
1)
Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?
1)the rectangle drawn will have a total width of 5 pixels
2)the rectangle drawn will have a total width of 6 pixels
3)the rectangle drawn will have a total width of 10 pixels
4)the rectangle drawn will have a total width of 11
2))public class Qcb90 {
int a;
int b;
public void f() {
a = 0;
b = 0;
int[] c = { 0 };
g(b, c);
System.out.println(a + " " + b + " " + c[0] + " ");
}
public void g(int b, int[] c) {
a = 1;
b = 1;
c[0] = 1;
}
public static void main(String args[]) {
Qcb90 obj = new Qcb90();
obj.f();
}
}
1)000
2)001
3)010
4)100
5)101
ans:101pixels
3)Which statements concerning the following code are true?
class A {
public A() {}
public A(int i) { this(); }
}
class B extends A {
public boolean B(String msg) { return false; }
}
class C extends B {
private C() { super(); }
public C(String msg) { this(); }
public C(int i) {}
}
1)the code will fail to compile
2)the contructor in A that takes ine as arg will never be called as a result of constructing an object of class B or C
3)class c has three constr
4)objects of class B cannot be constructed
5)at most one of the constructor of each class is called as result of constructing an object of class c
regards
vasu