![]() |
|
you have created a simple frame and overridden the paint method as follows
public void paint(graphics g){
g.drawstring("dolly",50,10);
}
what will be the result when you attempt to compile and run the program?
1) the string "dolly" will be displayed at the centre of the frame
2) an error at compilation complaining at the signature of the paint method
3) the lower part of the word dolly will be seen at the top of the frame, with the top hidden.
4) the string "dolly" will be shown at the bottom of the frame.
what will be the result when you attempt to compile this program?
public class rand{
public static void main(string argv[]){
int irand;
irand = math.random();
system.out.println(irand);
}
}
1) compile time error referring to a cast problem
2) a random number between 1 and 10
3) a random number between 0 and 1
4) a compile time error about random being an unrecognised method
[1] [2]