FirstNaukri
Home Search Jobs Govt JobsNew Resume Makernew Career Guidance Ask n Answer Student Ambassadors

Register|Login

  Ask n Answer
  Ask a Question
0 out of 300 characters

QUESTION
For real java programmers..

How to print ' Hello world 'outside the main(String [] args) without creating object of the class.
By Nitin K. Nandanka... (Beginner)  8 years ago   23 views
 
 Your Answer
0 out of 1250 character
 
 
 
Share |
Report Abuse
 
 
 
 
ANSWERS (3)
 
 
 
 
public class Hello {
static {
System.out.println('Hello, World!');
}
}
 
 
 
Know a better answer? Click here to post.
 
 
public class Testing
{
public static void main(String [] args)
{
String test = 'Hello world';
System.out.println(test);
}

}
 
 
 
Know a better answer? Click here to post.
 
 
don't know bro.
 
 
 
Know a better answer? Click here to post.
 
 
 
 
 

Ask & Answer
Panel of Experts

 
 
 
 
 
All rights reserved © 2022 Info Edge (India) Ltd.