• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Public Class

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
How many public classes can be there in one java Programme.
Pl tell me .
Navodit
 
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Navodit,
There can be unlimited public classes in one java PROGRAM. However, in any one java FILE there can only be one public class.
Hope this helps.
Stephanie
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Stephanie Grasson:
Navodit,
There can be unlimited public classes in one java PROGRAM. However, in any one java FILE there can only be one public class.
Hope this helps.
Stephanie


I think there will be 0 or 1 public class in one FILE.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There can be unlimited public classes in one java PROGRAM. However, in any one java FILE there can only be one public class.
which have main method.
Am I right or wrong
Pankaj
[email protected]
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes !
U can have just one public class (if at all any) in a file. But u can have any number of package level classes.
-sampaths77
 
reply
    Bookmark Topic Watch Topic
  • New Topic