Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Can we keep more than one class in java file?

user-image
Question ajoutée par gagandeep kaur gagan , internship , hcl-cdc
Date de publication: 2013/06/25
gagandeep kaur gagan
par gagandeep kaur gagan , internship , hcl-cdc

yes we can more than class in java file but only one class can be declare public

Ahmed Kamal
par Ahmed Kamal , web developer , EMRK Company

more than one

mohammad AbuElmagd
par mohammad AbuElmagd , Coordinator , Suez Canal Container Terminal (SCCT)

yes you can but no more one public class

RISHI PANIKKAVEETIL PALLATH
par RISHI PANIKKAVEETIL PALLATH , Software Engineer , Etisalat

<p>Yeah ofcourse, but only on one condition : any one of that class inside the java file must be of public and have same name as of that java file.</p>

Shivdhwaj Pandey
par Shivdhwaj Pandey , software engineering manager , the parentinc

<p>Yes but have command over how to use them.</p>

Bassem Zohdy
par Bassem Zohdy , Senior Software Architect , HelpAG

yes you can but only one of them public and its name is as same as the java file

<p>Yes ofcourse.We can do this through inner class concept.The different types inner class are static inner class,nonstatic inner class,local inner class,annonymous inner class.</p>

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?