JAVA – software engineer interview pills

50 questions interview java: ORM hibernate-JPA Hibernate ORM è un framework open source di Object Relational Mapping. Una raccolta di librerie Java per mappare (per rendere persistenti) i dati dall’ambiente Java al database. Hibernate implementa le specifiche JPA (Java Persistence API) per la persistenza dei dati. Ereditarietà? L’ereditarietà dunque consente di far ereditare attributi e metodi … Leggi tutto

OCA – Java Date

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

OCA – Java basics

Given the class // Filename: public class Test{ public static void main(String args[]){ for(int i = 0; i< args.length; i++){ System.out.print(” “+args[i]); } } } Now consider the following 3 options for running the program: a: java Test b: java Test param1 c: java Test param1 param2 Which of the following statements are true? … Leggi tutto

OCA – Java – methods

in Java, the order for initialization statements is as follows: PRIMA TUTTE LE COSE STATIC (sia fields che statements) NELL’ORDINE ESATTO IN CUI SONO INSERITI static variables and static initializers in order. instance variables and instance initializers in order. constructors. First, static statements/blocks are called IN THE ORDER they are defined. Next, instance initializer statements/blocks … Leggi tutto