React crash summary from Net Ninja

#2. A Look into the structure folders : node_modules + package.json node_modules contiene i file veri e propri delle dependencies installate mentre nel package.json c’è un json che fa riferimento alla lista di quelle dependencies. node_modules  è una cartella molto pesante e nel github non viene caricata. quando scarichiamo un progetto quindi per recuperare le … Leggi tutto

OCA – appunti generici brevi domande più frequen

Differenza pass by value  e by reference: Gli oggetti passati nei metodi vengono passati by reference e quindi gli effetti delle modifiche avvengono Note that Arrays are Objects (i.e. cA instanceof Object is true) so are effectively passed by reference I primitivi passati nei metodi invece si dice sono passati by value quindi a meno che non … Leggi tutto

OCA – Java Date

Date & Times: Per funzionare bisogna importare java.time.*; LocalDate contiene solo una data. Anno-mese-giorno. LocalDate.now() // 2022-07-07 LocalTime contiene solo un orario. LocalTime.now() // 18.13.123456789 LocalDataTime contiene data e orario. Nella sua stampa viene messa una T per separare la data dal time. LocalDataTime.now() // 2022-07-07T18.13.123456789 Per la creazione di una specifica data LocalDate date1 … Leggi tutto

OCA – Java collection

  Answered Correctly You had to select 3 option(s) Standard JDK provides no subclasses of ArrayList. It does. Direct Known Subclasses: AttributeList, RoleList, RoleUnresolvedList An ArrayList cannot store primitives. This is true because only objects can be stored in it. Note that the following is valid though: List l = new ArrayList(); l.add(1); Although 1 … Leggi tutto

Differences parseLong() and valueOf() and LongValue()

Differences Between parseLong() and valueOf()   Long.valueOf() Long.parseLong() It returns an Long object. It returns a primitive long. This method accepts String and long parameters. This method accepts only String as the parameter. It uses Long.parseLong() in its method implementation. It doesn’t use any helper method to parse the string as an Long. This method accepts a character as a parameter and returns its … Leggi tutto

OCA – String e Stringbuilder

String: method length() of String class is a final method. Actually, String class itself is final and so all of its methods are implicitly final. You can make mutable subclasses of the String class. Both – String and StringBuilder are final classes. So is StringBuffer. StringBuilder : StringBuilder extends String. StringBuilder extends Object StringBuilder is … Leggi tutto

OCA – JAVA Creating and Using Arrays

Which of the following statements about an array are correct? Every array has a built in property named ‘length ‘ which tells you the number of elements in the array. is not a  method! Otherwise ArrayList has a method named size() that returns the number of elements in the ArrayList. Arrays can be created for primitive types and … Leggi tutto