class FreshJuice { enum FreshJuiceSize{ SMALL, MEDIUM, LARGE } FreshJuiceSize size; }
What type of variable size?
size
Is FreshJuiceSize size;shorhand way of declaring sizeas an instance variable?
FreshJuiceSize size;
In your example, sizeis a member variable with type FreshJuiceSize(a enumlimited to 3 values you specify).
FreshJuiceSize
enum
, - : public, protected private. "package-private", , , . Java .
public
protected
private
. enum FreshJuiceSize.
enum FreshJuiceSize
FreshJuiceSize; shorhand ?
FreshJuiceSize, . " " " ".
The size of a variable of type FreshJuiceSize FreshJuiceSize is an enumeration, so the size takes only one of {SMALL, MEDIUM, LARGE} set
FeshJuice is a class - most likely, private - not the main one - judging by the absence of the declaration public class classname - FreshJuiceSize is the name of the enumeration (similar to the name of the array) and the size of FreshJuiceSize; declares a variable size member (I forget the term) FreshJuiceSize
Source: https://habr.com/ru/post/1667610/More articles:How to use @ types / jqueryui with angular2 (typescript) - typesAngular 2: dynamically get LOCALE_ID (allow for each request) - dependency-injectionHow can I sum the product of two list items using for loop in python? - pythonZero initializer for offsets using get_variable in a tensor stream - initializationA more elegant way to calculate intragroup proportions in dplyr? - rCreating a cluster histogram on two columns in bokeh - pythonUser Policies in Azure AD B2C - azureEdit long format multi-format formats with Pandas - pythonUnderestimation of the maximum numerical expression - maximaHTML text area inside ReactJS component cannot be programmatically selected without setTimeout? - javascriptAll Articles