You are here: Home / Topics / Declare variable at the end of Java Program

Declare variable at the end of Java Program

Filed under: Java on 2023-08-11 19:15:13

// declare variable at end

class  DeclareAtEnd
{
public static void main( String args[ ] )
{
 msg = "Hello Java Developer..!";
       System.out.println("Message : " + msg);
}

static String msg;
}

Output:

Message : Hello Java Developer..!

About Author:
V
Vinay Kumar     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.