Question 1
Given the code fragment:
String str = "Java is a programming language"; ToIntFunction<String> indexVal = str: : indexOf; //line n1 int x = indexVal.applyAsInt("Java");//line n2 System.out.println(x);
What is the result?
String str = "Java is a programming language"; ToIntFunction<String> indexVal = str: : indexOf; //line n1 int x = indexVal.applyAsInt("Java");//line n2 System.out.println(x);
What is the result?
Question 2
Given the content of /resourses/Message.properties:
welcome1="Good day!"
and given the code fragment:
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream ("/resources/Message.properties");
prop.load(fis);
System.out.println(prop.getProperty("welcome1"));
System.out.println(prop.getProperty("welcome2", "Test"));//line n1
System.out.println(prop.getProperty("welcome3"));
What is the result?
welcome1="Good day!"
and given the code fragment:
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream ("/resources/Message.properties");
prop.load(fis);
System.out.println(prop.getProperty("welcome1"));
System.out.println(prop.getProperty("welcome2", "Test"));//line n1
System.out.println(prop.getProperty("welcome3"));
What is the result?
Question 3
Given:

And given the code fragment:


And given the code fragment:

Question 4
Given:

and the command:
java Product 0
What is the result?

and the command:
java Product 0
What is the result?
Question 5

What is the result?
