Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ALL in java. 1.What is keyword static used for? 2.How often can the state of a c

ID: 3841452 • Letter: A

Question

ALL in java.

1.What is keyword static used for?

2.How often can the state of a constant change?

3.What does an object’s member function read/write the state of?

4.How do I read or write the data associated with the class itself?

5.What object model does maven use for code management?

6.What 2 main techniques can be used to build a project in maven?

7.Under what condition must a class be declared abstract?

8.What is the purpose of keyword default?

9.Give an example of a list (or other collection) that exhibits polymorphism?

10.What type of data may be declared and initialized in an interface?

11.Under what condition is it permissible for a subclass to not implement a method from an abstract superclass?

12.What keyword is used to refer to the current object?

13.How many Interfaces can be implemented by a single class?

14.How many interfaces can a subinterface extend?

15.in what two ways can we instantiate a thread?

16.What is the difference between multiprocessing and multithreading?

17.How many Abstract Classes can a subclass extend?

18.What two techniques can be used to change the appearance of a JavaFx UI?

19.What Java package are collections (data structures) located in?

20.What are the benefits to Unit testing code (Junit)?

21.What 3 parameters are used in assertEquals()?

22.In assertEquals(), what is the delta argument used for?

23.Test Classes and methods build up into what larger testing structure?

24.What is the difference between autoboxing and unboxing?

25.If no access specifier is used, what type of default access is applied to a class?

26.What is the purpose of keyword protected?

27.What purpose do annotations serve?

Explanation / Answer

1. static keyword is used for data or functions which are commom or need to have shared space between different object of the class. eg. to count number of objects of the class we can have a static counter.

2. State of constant cannot be changed. the value of constants cannot be changed after instantiation.

3. object's member function read or write the values of data members declared in the class or is in scope of object. After processing, they try to read or modify the values assigned to data members.

4. to read and write the data associated with the class, if the data is private, then we need to have accessors and mutators functions , if they are public then they can directly be accesed via object reference.

5. Maven use POM or project object model for project management. POM is a XML file having details of project ans configuration which is needed for building project.

6. there are various ways to build the maven project. One is to use command prompt and run the maven tool via maven commands .. other way is to use jenkins to build the maven.

7. class can be declared abstract if it is generalized view of something and can have common properties of different objects . eg Vehicle class can be declared abstract which can be extended by Car, Bike, Truck etc.

8. Default keyword is used in switch statements to declare the instructions which needs to be run if no case is matched. It is also used to declare default values.

9. Collections like ArrayList can be used and declared with abstract class and can be instantiated with child classes. eg.

ArrayList<Vehicle> vehicles = new ArrayList<Car>();

10.In interfaces we can declare and initialize final or constants which cannot be modified.

11. If the method is defined in abstract class it is not necessary to.implement in subclass.

12. this keyword is used to refer to current object .

13. A class can implement any number of interfaces but extend only one class.

14. Interface can extend any number of interfaces.

15. Threads can be instantiated by extending thread class or implementing Runnable interface.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote