I am trying to read a value which is in a class (in a public void) in anothe class and I couldn't do that, so please can someone reply me and tell me how to do that using these code.

public class CDB  {

    public static String main(String[] args) {
    String animal_name="cat";
    public class conn extends CDB {
    //What code  should enter here to read the value(animal_name)
Be a part of the DaniWeb community

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