Contact Admin for Dumps and Queries

Just drop a mail to javasnips@gmail.com with subject as "SCJP Dumps" or "SCWCD/SCBCD Dumps".

How to print some statement to the console without using main()::::Google Interview Question----FAQ

Interviewer: Is it possible to print some statement to the console without using main()? If it is yes...How?

Interviewee: Yes sir,...As follows

class SCJP
{ static
{ System.out.println("SCJP-FAQ");
System.exit(0);
} }

Interviewer: Fine. Then Is it possible to print some statement to the console without using main() and a static block?

Interviewee: Yes sir, No problem at all...As follows

class SCWCD
{ static int i=m1();
public static int m1()
{ System.out.println("SCWCD-FAQ");
System.exit(0);
return 10;
} }

Java---Points to Remember

A java Source file can contain any number of public classes but utmost one class can be declared as "public".

Visitor Count

hit counter