I want to ask >>what is the use of (string args[])???
and how can I use system.exit >>without intially import the package (java.lang) ?
thanks ^^

import javax.swing.JoptionPane;
public welcome1 {
public static void main (stirng args[]){
JoptionPane.showMessageDialoge(null,"welcome to java");

When someone runs your program from the command prompt (or batch file etc) they can add parameters to their command. You get a copy of those parameters in the String array.

java.lang.* is imported by default in all Java programs

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.