in a console we r giving java <class name> if r pressing
enter where it'll goes

Answers were Sorted based on User's Feedback



in a console we r giving java <class name> if r pressing enter where it'll goes..

Answer / sai

It'll goes to the JVM and then executes..

Is This Answer Correct ?    8 Yes 1 No

in a console we r giving java <class name> if r pressing enter where it'll goes..

Answer / srujan jack

it transfers the class name to JVM then the JVM calls main() method using class name.
there fore the main() method must be declared with public & static.....

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

How do you define a method?

0 Answers  


public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod

4 Answers   TCS,


Can you access the private method from outside the class?

0 Answers  


Why wait and notify methods are declared in object class?

0 Answers  


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

0 Answers  


What is an anonymous class in java?

0 Answers  


Differentiate between postfix and prefix operators in java.

0 Answers   HCL,


What is size () in java?

0 Answers  


Can each java object keep track of all the threads that want to exclusively access it?

0 Answers  


What is audio clip interface? Name few methods of it ?

1 Answers  


Can array grow dynamically in java?

0 Answers  


Is treeset sorted in java?

0 Answers  


Categories