Find The Expected Output From These Code Segments:: BITP 3113 Exercise
Find The Expected Output From These Code Segments:: BITP 3113 Exercise
1/5
BITP 3113 Exercise
class Base {
public static void show() {
System.out.println("Base::show() called");
}
}
class Main {
public static void main(String[] args) {
Base b = new Derived();;
b.show();
}
}
2/5
BITP 3113 Exercise
class Grandparent {
public void Print() {
System.out.println("Grandparent's Print()");
}
}
class Base {
public void foo() { System.out.println("Base"); }
}
3/5
BITP 3113 Exercise
class Base {
public void show() {
System.out.println("Base::show() called");
}
}
class Base {
final public void show() {
System.out.println("Base::show() called");
}
}
class Main {
public static void main(String[] args) {
Base b = new Derived();;
b.show();
}
}
4/5
BITP 3113 Exercise
Shirt
- shirtCode : String
- description : String
- size : char S=small M=medium L=large
- color : char B=blue R=red G=green Y=yellow
- unitPrice : double
- quantityInStock : int
- replenishStock : boolean
+ Shirt(shirtCode:String, quantityInStock:int, unitPrice:double)
+ calculateTotalStockValue():double
+ displayDetails():void
5/5