88.5k views
0 votes
What is the output of the following JAVA program?

class simple
{
public static void main(String[ ] args)
{
simple obj = new simple( );
obj.start( );
}
void start( )


A. 12 : 15
B. 15 : 12
C. 12 : 12
D. 15 : 15

User Ggranum
by
7.2k points

1 Answer

2 votes

The provided Java program lacks completion and will not compile. Assuming completion with a simple `start()` method, the output would be "12 : 12" due to the print statement within the method. Option C is correct.

The provided Java code is incomplete and won't compile successfully. It lacks the closing brace for the `start()` method and the class. Assuming the completion is as follows:

class simple {

public static void main(String[] args) {

simple obj = new simple();

obj.start();

}

void start() {

int a = 5;

int b = 7;

System.out.println(a + " : " + b);

}

}

The correct output would be:

C. 12 : 12

User Vidur Punj
by
8.3k points