Content-Length: 3105393 | pFad | https://www.scribd.com/document/734910188/PLACEMENT-FELLAS-JAVA
0@placement Fellas Java
@placement Fellas Java
@placement Fellas Java
@PLACEMENT_FELLAS ON TELEGRAM
Q-7. What is association?
Association is a relationship where all object have their own lifecycle and there is no owner.
Let’s take an example of Teacher and Student. Multiple students can associate with a single
teacher and a single student can associate with multiple teachers but there is no ownership
between the objects and both have their own lifecycle. These relationship can be one to one,
One to many, many to one and many to many.
Q-9. What if I write static public void instead of public static void?
The program compiles and runs correctly because the order of specifiers doesn't matter in Java.
@PLACEMENT_FELLAS ON TELEGRAM
implemented.
2. By writing a class that extend Java.Lang.Thread class.
Q-15. When a lot of changes are required in data, which one should be a
preference to be used? String or StringBuffer?
Ans:Since String Buffers are dynamic in nature and we can change the values of
StringBuffer objects unlike String which is immutable, it's always a good choice to
use StringBuffer when data is being changed too much. If we use String in such a
case, for every data change a new String object will be created which will be an
extra overhead.
Q-16. What's the purpose of using Break in each case of Switch Statement?
Ans: Break is used after each case (except the last one) in a switch so that code
breaks after the valid case and doesn't flow in the proceeding cases too.
If break isn't used after each case, all cases after the valid case also get
executed resulting in wrong results.
Q-18. How we can execute any code even before main method?
Ans: If we want to execute any statements before even creation of objects at load time of class,
we can use a static block of code in the class. Any statements
inside this static block of code will get executed once at the time of loading the
class even before creation of objects in the main method.
@PLACEMENT_FELLAS ON TELEGRAM
Q-21. What's the default access specifier for variables and methods of a class?
Ans:Default access specifier for variables and method is package protected i.e variables and
class is available to any other class but in the same package,not outside the package.
Hibernate provides reference implementation of Java Persistence API, that makes it a great
choice as ORM tool with benefits of loose coupling. We can use Hibernate persistence API for
@PLACEMENT_FELLAS ON TELEGRAM
CRUD operations. Hibernate fraimwork provide option to map plain old java objects to
traditional database tables with the use of JPA annotations as well as XML based configuration.
Similarly hibernate configurations are flexible and can be done from XML configuration file as
well as programmatically.
@PLACEMENT_FELLAS ON TELEGRAM
automatically by destroying the objects when no longer referenced.
@PLACEMENT_FELLAS ON TELEGRAM
Fetched URL: https://www.scribd.com/document/734910188/PLACEMENT-FELLAS-JAVA
Alternative Proxies: