473,395 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Access keywords with classes

Hi,

I understand how access keywords like public, private, protected etc
work when it comes to using them in method declarations, but how do they
work when it comes to class declarations?

For example, what would the following mean:

namespace example {
public class Foo {
...
}

private class Bar {
...
}

protected class FooBar {
...
}
}

Why would I use any of the above instead of just declaring my classes
with like "class Foo"?

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!
Mar 27 '06 #1
4 1176
How about the internal class?
class example { public class Foo {} private class Bar{} } ...
then you have class ExtendedExample : .... you will see the difference

Mar 27 '06 #2
Hi,

You can't have a private class directly within in a namespace. It
would mean that the class is not visible to anything.. if the class
isn't visible to anything, how could it ever be used? Same goes with
protected. You'd actually get compiler errors if you try to have a
private or protected class nested at the namespace level.

You could have an internal class however; that would be a class which
only members of the same assembly could see.

HTH
Andy

Mar 27 '06 #3
Pondering the eternal question of "Hobnobs or Rich Tea?", Andy finally
proclaimed:
You could have an internal class however; that would be a class which
only members of the same assembly could see.


Ah I see. It's starting to make sense now, thanks.

--
Dylan Parry
http://webpageworkshop.co.uk -- FREE Web tutorials and references
Mar 27 '06 #4
Pondering the eternal question of "Hobnobs or Rich Tea?",
ha*********@gmail.com finally proclaimed:
How about the internal class?


Yes, that's something else that I'm totally ignorant of! :) From Andy's
reply I'm starting to understand it.

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!
Mar 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Jason Heyes | last post by:
I want to write a class that supports operations on keywords belonging to the C++ programming language. The following program repeatedly prompts the user for a keyword until 'explicit' is finally...
47
by: rawCoder | last post by:
Hi, Just wanted to know if there is any speed difference between VB conversion Keywords like CInt, Clng, CStr, CDbl, CBool etc. ..NETs Convert.To<...> methods. And which is better to be...
10
by: Jon | last post by:
I'm investiging multi-threaded GUI applications; specifically the technique used to ensure that controls are only modified under the correct thread. The standard technique is to use ...
3
by: Dhruba Bandopadhyay | last post by:
I am a current ASP developer. I have files: ServiceClass.asp & SessionClass.asp which are included in many of my asp files. Then they call objService = New Service (by using the Class Service...
3
by: zombek | last post by:
Hi. I'm quite a begginer. I wanted to learn the usage of tinyxml library so I wrote a little program which compiles on g++ 4.1.1 with -O2 -Wall, but when I run it a get a message "memory access...
3
by: Stephan | last post by:
Hi all, I am new to access and I face the following "issue": I would like to create a database, to which users can upload files (=pdf, doc, xls...). The files shall be stored locally on a...
23
by: Bosnoval | last post by:
Access 2003 Databse ASP.NET 2 Win 2003 Server Currently I have a search page that only allows a single keyword (person) to be searched at a time. I thought upgrading that option via a multiple...
7
by: Maximus Decimus | last post by:
HI all, I am using python v2.5 and I am an amateur working on python. I am extending python for my research work and would like some help and guidance w.r.t this matter from you experienced...
1
by: beemomo | last post by:
Hi everyone there, i am facing the problem with using the SQL condition --LIKE in a multi value field of my access 07 table. I have a multi value field which store a number of keywords for a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.