Questions tagged [public]

`public` is an access-specifier in object-oriented languages; it indicates that all objects have access to the `public` field or method.

In object-oriented languages, classes specify how much access other classes can have to their members.

When a member has the public specifier, other classes have full access to that member.

Other access specifiers are protected and private.

You can use this tag for questions about how the public specifier controls (or fails to control) access to the members of a class, and questions on how it interacts with the other access specifiers.

1633 questions
0
votes
3 answers

Modifying my method as String instead of void

I currently have a method called tomorrow() which modifies an objects attributes which in this case are day, month, year (This ins't java.util.Date, I've made my own Date constructor.) So if for example I had an object called date1(30,12,2013) and I…
0
votes
1 answer

How to compute path to file in public folder?

I created a folder called Uploads in my public folder. I'd like to have people be able to click a link and download a file in that Uploads folder. Here's my code:

Certifications <%= link_to @tutor.tutor_degrees.first.name, # => "AS…

sergserg
  • 21,716
  • 41
  • 129
  • 182
0
votes
1 answer

EPub encryption with private / public key

I am trying to encrypt whole EPub's XHTML / HTML files using a private key, and then append a public key in META-INF/encrpytion.xml so that the user would be able to read the book this way. Private / public key pair is unique based on many…
kbs1
  • 35
  • 2
  • 6
0
votes
5 answers

creating a class with class name

I am a beginner in Java. Could anyone please help me understand the following concept? What I have done here is I tried to create a class as Sample, which I mentioned below, where I am printing You are in Main Method class Sample { public…
user1396008
0
votes
1 answer

Filter nested DTOs with key

I have List of DTO Suach as : Public Class UKey { public Int64 Key{ get; set; } } Public Class Test : UKey { public Int64? CityId { get; set; } public Test2 test2{ get; set; } } Public Class Test2 : UKey { public Int64?…
M.Mohammadi
  • 1,558
  • 1
  • 13
  • 25
0
votes
2 answers

Using Node in Map, C++

class MtmMap { public: class Pair { public: Pair(const KeyType& key, const ValueType& value) : first(key), second(value) { } const KeyType first; …
Christine
  • 113
  • 3
  • 9
0
votes
6 answers

Internal getter, public setter c#

I basically want to do something like this public string Password { set { password = value; } } internal string Password { get { return password; } } But without having to call my second function something else (the code above will not compile…
friartuck
  • 2,954
  • 4
  • 33
  • 67
0
votes
2 answers

How to add scopes to an existing Shopify App Installers

I have built Shopify public app with Read Orders Scope only, Now i just realized that i will have to also add a new asset to my installers store. I can't add the new 'write_theme' scope to my Auth request because i am getting an error from Shopify…
Dayan Roee
  • 61
  • 1
  • 8
0
votes
1 answer

Doxygen not working on Public block(s) after Private block in Class

How do I tell Doxygen to document public sections after a private section in a (C++) class? E.g. class Brg { public: //! this function will be documented void documentedFunction1() private: void irrelevantFunction() public: …
user174069
0
votes
1 answer

Regarding memory of classes public type functions

When using constructor of a class to create object, it uses and stores some memory space. Creating more objects uses more space. My question is: if that class had many public type functions, logically more space will be spent, but when creating more…
Dainius Kreivys
  • 525
  • 2
  • 8
  • 19
0
votes
2 answers

PHP making a protected property public at runtime

Problem: I don't want to expose $myProperty, that is it shouldn't be public, but I need it to be public just for __toString(): class A { protected $myProperty; public function __toString() { return json_encode($this); } } I…
gremo
  • 47,186
  • 75
  • 257
  • 421
0
votes
3 answers

FUELPHP - Changing the name of the "public" folder

in my public folder is called "public_html", so I wonder how can I configurate fuel to use the "public_html" instead of the "public" Thanks!
Artur Couto
  • 498
  • 1
  • 6
  • 19
0
votes
1 answer

importing another css file from a css file under public asset does not work for play 2.0.4

I am pretty new to play and I am trying to use play 2.0.4 scala version with twitter bootstrap. I also got a theme from wrapbootstrap. The theme has certain customized css files which i put under public/stylesheets. I end up with two css files under…
0
votes
1 answer

Match url and redirect to url+/index.html in rails

I want to redirect some links that point to my public folder in Rails. For example: http://site.com/example should redirect to http://site.com/example/index.html I only want to do this for the content that is my public folder. I tried this in the…
Ilea Cristian
  • 5,741
  • 1
  • 23
  • 37
0
votes
4 answers

C++ public and private datatypes

I am currently working on Chapter 7 in the book "Starting Out With C++ Early Objects" by the Pearson printing company. I am unable to understand the function of the variable 'r' in this class declaration: class Circle { private: double…
Robert
  • 123
  • 4