Menu
Question Index
...

What will be the output of the following program?

import java.lang.reflect.*;
public class Search {
    public static String data;
    public static void main(String[] args) throws NoSuchFieldException {
        data = "songs";
        Search input = new Search();
        Class cls = input.getClass();
        Field folder = cls.getField("data");
        System.out.println(folder);
    }
}


java.lang.String Search
public static java.lang.String Search.data
Compilation Error
Runtime Error

Doubts

Problems

Topic: Advanced Java Programming Concepts

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App