The Artima Developer Community
Sponsored Link

Design Forum
Can packages and classes have same name?

2 replies on 1 page. Most recent reply: Apr 17, 2003 11:05 AM by david

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
mahesh

Posts: 3
Nickname: maccoy
Registered: Mar, 2003

Can packages and classes have same name? Posted: Mar 10, 2003 9:17 AM
Reply to this message Reply
Advertisement
Can a class in a package contain the same name as the packages?.
say class name - jackal
Package name jackal

Though there will not be any problem for accesing , is it conceptually correct?


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Can packages and classes have same name? Posted: Mar 10, 2003 5:50 PM
Reply to this message Reply
It is possible to do, but would be a violation of the accepted convention. The words in class names are capitalized, by convention, whereas package names are normally all lower case (this was not true with the first release of Java, but it is now). So in your example, the package would be jackal and the class would be Jackal. There are other reasons that this is unlikely to occur in professional code, such as the fact that the package is normally a company's or organization's "reversed" url or pseudo-url, as in com.suiterunner.Suite.

david

Posts: 1
Nickname: berkovic
Registered: Apr, 2003

Re: Can packages and classes have same name? Posted: Apr 17, 2003 11:05 AM
Reply to this message Reply
http://www.istanbulhotelsonline.com
http://www.istanbulhotelsonline.net
http://www.istanbulhotelsonline.org
http://www.turkeyhotelsonline.com
http://www.turkeyhotelsonline.net
http://www.turkeyhotelsonline.org
http://www.magnificenttravel.com
http://www.hoteltourturkey.com
http://www.travelturkey.org
http://www.senatorhotel.com
http://www.senatorhotel.com.tr
http://www.yigitalp.com
http://www.istanbulhotelyigitalp.com
http://www.estambulhotelyigitalp.com
http://www.istanbul-hotels-tours-car-rental.com
http://www.maceratur.com
http://www.surotel.com
http://www.cappadocia-hotels-tours.com
http://www.cappadocia-hotel-tour.com
http://www.discount-antalya-hotels.com
http://www.ephesus-hotels-tours.com
http://www.ephesus-hotel-tour.com
http://www.car-rental-istanbul-turkey-line.com
http://www.greece-hotels-tours.com
http://www.hotels-in-istanbul-tours-turkey.com
http://www.istanbul-hotels-tours-reservation.com
http://www.my-istanbul-hotels.com
http://www.popular-istanbul-hotels.com
http://www.special-istanbul-hotels.com
http://www.cr-turkey.com
http://www.gallipoli-anzac-tours.com
http://www.gallipoli-anzac-days.com
http://www27.brinkster.com/hoteltourturkey/
http://www.turkeytoursonline.com
http://www.bad-and-breakfast-istanbul-hotel.com
http://www.istanbul-turkey-book-hotels.com
http://www.booking-istanbul-turkey-hotels.com
http://www.cheap-vacation-istanbul.com
http://www.cheap-vacations-istanbul.com
http://www.lodging-in-istanbul-reservations.com
http://www.discount-istanbul-turkey-hotels.com
http://www.acommodation-in-istanbul.com
http://www.turkeyhotels-istanbulhotels.com
http://www.accommodation-in-istanbul.com
http://www.accomodation-in-istanbul.com
http://www.toruko-istanbul-hotels.com
http://www.toruko-hotels-istanbul.com
http://www.hotels-tours.net
http://www.nenahotel.com
http://www.hotelnena.com
http://www.gulsenrose.com
http://www.hotels-in-istanbul.us
http://www.petrolhotel.com
http://www.hotelpetrol.com
http://www.naturmed.biz
http://www.ikinciel-oto.com
http://www.istanbulhotelsonline.com/5star.htm
http://www.istanbulhotelsonline.com/4star.htm
http://www.istanbulhotelsonline.com/3star.htm
http://www.istanbulhotelsonline.com/2star.htm
http://www.istanbulhotelsonline.com/oldcity.htm
http://www.istanbulhotelsonline.com/newtown.htm
http://www.istanbulhotelsonline.com/istanbul.htm
http://www.istanbulhotelsonline.com/hostels.htm
http://www.istanbulhotelsonline.com/ottoman.htm
http://www.istanbulhotelsonline.com/anzac1.htm
http://www.istanbulhotelsonline.com/pamukkale.htm

Flat View: This topic has 2 replies on 1 page
Topic: Composite pattern Previous Topic   Next Topic Topic: Event Dispatching & Focus Handling

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use