Multiple Choice Question

Quiz Guidelines

 

QID: 
459
Question: 

What will the following code print when run?

class A{
String value = "test"; A(String val){
this.value = val;
}
}
public class TestClass {
public static void main(String[] args) throws Exception { 
new A("new test").print();
}
}

Select 1 option

A. test
B. new test
C. It will not compile.
D. It will throw an exception at run time.

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!