I have been given a class and i have been asked to write short programs in order to find out the answer.

The first question is: "what is the result of calling method1(without parameters)?"

The program i was given is below:

package ;

// approximate imports
import java.awt.Frame;
import java.awt.event.WindowListener;
import java.awt.Canvas;
import java.lang.String;
import java.awt.Graphics;
import java.awt.Color;
import java.awt.event.WindowEvent;

synchronized class CW49 extends Canvas implements WindowListener {
// fields
Graphics g;
Frame f;
String attribForMethod1;
Color backgroundColourForMethod2;
Color foregroundColourForMethod2;
int attribForMethod3;
int attribForMethod4;
String attrib1ForMethod5;
double attrib2ForMethod5;
int attribForMethod6;
int maxForArray1;
int maxForArray2;
int valueForIntArray49;
int valueForIntArray50;
int valueForIntArray51;
String valueForStringArray69;
String valueForStringArray70;
String valueForStringArray72;
final int ARRAYMAX1;
final int ARRAYMAX2;
int[] array1;
String[] array2;
int resultForMethod4;

public CW49() {
// CONSTRUCTOR implementation not available
}

public CW49(int p0) {
// CONSTRUCTOR implementation not available
}

public int[] getIntArray() {
// implementation not available
}

public String[] getStringArray() {
// implementation not available
}

public void method4() {
// implementation not available
}

public void method1() {
// implementation not available
}

public int method3() {
// implementation not available
}

public void paint(Graphics p0) {
// implementation not available
}

public void method2() {
// implementation not available
}

public void method5(int p0) {
// implementation not available
}

public void method6() {
// implementation not available
}

public void initializeArray1() {
// implementation not available
}

public void initializeArray2() {
// implementation not available
}

public void windowClosing(WindowEvent p0) {
// implementation not available
}

public void windowClosed(WindowEvent p0) {
// implementation not available
}

public void windowOpened(WindowEvent p0) {
// implementation not available
}

public void windowOpening(WindowEvent p0) {
// implementation not available
}

public void windowIconified(WindowEvent p0) {
// implementation not available
}

public void windowDeiconified(WindowEvent p0) {
// implementation not available
}

public void windowDeactivated(WindowEvent p0) {
// implementation not available
}

public void windowActivated(WindowEvent p0) {
// implementation not available
}

private void pause() {
// implementation not available
}

}

You can't call another Class' private method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.