collection - we use it when we want to group objects of different types into one bucket. Remember that each item in a collection is an object. Example ArrayList adds all items in the form of objects so we were taking out values from the ArrayList instance then we must type from object type to its corresponding type Here item is of object type, and we are type casting it to its corresponding type. collection Initializer - The group of object initializers are nothing but collection Initializer Object Initialzier - It is used to initialize the data members or properties of a class.To avoid creating multiple constructor of a class, we go for Object Initialzier. Object initializers creates parameterless constructor internally. The curly braces opening and closing is called Object initializers block.
S1 : install node software s2 : install VS code software s3 : Open VS code editor. Open the extensions windows. Install two software JavaScript (ES6) snippets Code Runner - By Jun Han s4 : Open new terminal window and type "npm install prompt-sync" --->This is used to prompt user input s5 : Type the JavaScript code as shown in the below screenshot. s6 : There is Run button on the right side of the window. Click on it to run the program. s7: Console will ask for input from the user, if it is not allowing to edit then do the following open settings and type code runner and then put a check mark on that option. s8: Re-run the program
Comments
Post a Comment