Post Test Flashcards
Which of the following statements are true for Java 8 environments?
a. JVM is responsible for converting java byte code into machine specific code
b. JDK is required to compile java programs.
c. JRE does not contain JVM.
d. JRE software contains javac compiler.
e. None of the above
a. JVM is responsible for converting java byte code into machine specific code b. JDK is required to compile java programs.
Which operator returns a boolean if the two operands have the same value?
a. ?:
b. ==
c. ^
d. =
e. None of the above
b. ==
Which of the following is valid initialization code?
a. Int x = 3;
b. String age = 44;
c. float f = “NewFloat”;
d. Integer int = new Integer;
e. None of the above
e. None of the above
If you want your conditional to depend on two conditions BOTH being true, what is the proper notation to put between the two boolean statements?
a. AND
b. &&
c. OR
d. II
e. None of the above
b. &&
What is the proper way to declare a variable?
a. variableName variableType;
b. variableName;
c. variableType;
d. variableType variableName;
e. None of the above
d. variableType variableName;
Which of the. following primitive data type may be used to store the integer value of 128?
a. byte
b. short
c. int
d. char
b. short c. int
What is the range of values for char data type variable?
a. -215-1 to -215
b. -215 to -215-1
c. \u0000 to \uFFFF
d. \0000 to \FFFF
e. None of the above
c. \u0000 to \uFFFF
What is the output of the following code?
System.out.println ;
a. The interest amount is =1005.0
b. The interest amount is =25.0
c. The interest amount is =125.0
d. The interest amount is =105.0
e. Code cannot compile, will result in compile error.
a. The interest amount is =1005.0
What is the output of the following code?
java.lang.Double height = new java.lang.Double32.34);
System.out.println;
a. 32.34
b. 32.0
c. 32
d. This code block will result in compile error.
e. none of the above
b. 32.0
Which of the following is the correct syntax to declare Scanner class object?
a. Scanner objectName = Scanner;
b. Scanner objectName = new Scanner;
c. Scanner objectName= Scanner;
d. Scanner objectName = new Scanner;
e. None of the above.
d. Scanner objectName = new Scanner(System.in);
Which is a valid structure for the syntax of a method declaration in a class?
a. private printOutput
b. protected Customer locateProfile CustomerNotFoundException
c. public Account openAccount
d. public Double getPrice;
e. None of the above
c. public Account openAccount(String name, double balance)
Which of the following statements about interfaces and abstract classes is FALSE?
a. A class can implement only one interface
b. Method declarations in interfaces must end in a semi-colon
c. A class can be a subclass of multiple abstract classes
d. Abstract classes can contain fields that are not static and final
e. None of the above
a. A class can implement only one interface
Which of these statements is true? Select the one correct answer.
a. For each try block there must be at least one catch block defined.
b. A try block may be followed by any number of finally blocks.
c. A try block must be followed by at least one finally or catch block.
d. Finally block is placed before any catch block.
e. None of the above
c. A try block must be followed by at least one finally or catch block.
Which access modifier makes a member available only to classes within the same
package and subclasses in any other package?
a. private
b. protected
c. public
d. package-private
e. None of the above
b. protected
What is the output of the following code block?
String[ ] numbers = {“10”, “20”, “34”, “56”};
System.out.println + 10);
a. 2010
b. 30
c. 20
d. 1010
e. None of the above
b. 30
Which of the following statements are true?
a. final methods cannot be overridden in sub classes
b. final field values cannot be changed after initialization
c. abstract classes cannot have final methods
d. abstract class cannot have final fields
e. None of the above
a. final methods cannot be overridden in sub classes
b. final field values cannot be changed after initialization
Which of the following is valid initialization code?
a. int x =3;
b. char c = 44;
c. String s = ‘b’;
d. Integer int = new Integer;
e. None of the above
a. int x =3;
b. char c = 44;
What is true about “casting”?
a. Casting is only possible between primitives
b. Involves the duplication of one object to another object
c. Casting implicitly takes place during numeric conversion
d. Casting requires a magic user with at least 16 in INT and DEX
e. None of the above
e. None of the above
Which statement best describes Spring Beans? Choose one.
a. They are instantiated using the ‘new’ keyword.
b. They are Java Classes.
c. They are objects managed by a Spring container.
d. They are configured using xml.
e. None of the above
c. They are objects managed by a Spring container.
True or False: the ApplicationContext is used to access the Spring container in your
code?
a. True
b. False
a. True
Which of the following is not a Spring application context?
a. ClassPathXmlApplicationContext
b. FileSystemXmlApplicationContext
c. FileSystemAnnotationApplicationContext
d. AnnotationConfigApplicationContext
e. None of the above
c.FileSystemAnnotationApplicationContext
Which of the following is not true of Annotations?
a. They start with the “@” symbol
b. They are used to add metadata to source code.
c. They only apply to classes.
d. They are recognized by the Spring container
e. None of the above
c. They only apply to classes.
Which one of the following is true of this XML element: ?
a. It is added to the web.xml file.
b. It provides functionality similar to that of @Autowired
c. It enables auto scanning for Spring Beans.
d. It typically includes the ‘base-classes’ attribute
e. None of the above
c. It enables auto scanning for Spring Beans.
Which of the following are true of ‘Dependency Injection’?
a. DI instantiates and provides objects required in Spring classes.
b. DI replaces the need for classes to instantiate objects on their own.
c. DI allows alternate implementations to be substituted based on configuration.
d. All the above.
e. None of the above
d. All the above.
What is purpose of the @Autowired annotation?
a. It documents jar level resources.
b. It allows bean classes to be detected by type.
c. It allows beans to be injected by type.
d. It is essentially the same as @Component
e. None of the above
c. It allows beans to be injected by type.
True or False, Dependency injection increases coupling?
a. True
b. False
b. False
Which of the following is a benefit of configuring Spring via XML?
a. Configuration is compiled along with the code.
b. Metadata from an XML file is always in sync with the Java code.
c. Configuration can be changed without recompiling code.
d. It provides less possibly points of failure.
e. None of the above
c. Configuration can be changed without recompiling code.
True or False, Spring beans are singletons by default?
a. True
b. False
a. True
Which best describes the purpose of an @Configuration class?
a. It includes methods that you can call in your code.
b. It takes the place of the container’s dependency injection code.
c. It provides metadata that the container can use to create bean instances for
injection.
d. It is executed just like any other Java code.
e. None of the above
c. It provides metadata that the container can use to create bean instances for injection.
What is the purpose of @Value?
a. It marks data that can injected using the string “jdbx.url”.
b. It injects a value from an external property file into a variable.
c. It replaces the name of the item being injected with an alias.
d. It injects the string “jdbc.url” literally into a variable.
e. None of the above
b. It injects a value from an external property file into a variable.
Which of the following is not a Spring module?
a. AOP
b. O/R Integration
c. Spring MVC
d. HTML/JSP
e. None of the above
d. HTML/JSP
Given a REST service that returns information about orders, including the various
items of each order, what might the URI look like for getting the second item of the
third order?
a. /orders3items2
b. /orders/1/items/2
c. /orders/2/items/3
d. /orders/3/items/2
e. None of the above
d. /orders/3/items/2
Annotations work as metadata for classes and Spring uses annotations as an
alternative to XML for declarative configuration. Is it true or false?
a. True
b. False
c. Do not know
a. True
In Spring Web App Environment, which of the following acts as a Front Controller?
a. @RestController
b. DispatcherServlet
c. Models
d. Views
e. None of the above
b. DispatcherServlet
Which of the following statements are true of Maven and Spring?
Select all that apply.
a. Maven is a build tool
b. Maven manages dependencies
c. Maven handles refactoring
d. Maven is useful for Spring development
e. Maven is required for Spring development
a. Maven is a build tool
b. Maven manages dependencies
d. Maven is useful for Spring development
@RequestMapping annotation is used to map a HTTP request method to a specific class or method in the controller which will handle the respective
request. Is it true or false?
a. True
b. False
c. Do not know
a. True
Which of the following layers uses the @Controller annotation for classes?
a. Service layer
b. Presentation layer
c. Business layer
d. Session layer
e. None of the above
b. Presentation layer
Which of the following statements is true?
a. BeanFactory implements ApplicationContext
b. BeanFactory extends ApplicationContext
c. ApplicationContext extends BeanFactory
d. ApplicationContext implements BeanFactory
e. None of the above
c. ApplicationContext extends BeanFactory
Which of the following HTTP Status code means OK, shows success?
a. 200
b. 201
c. 204
d. 304
e. None of the above
a. 200
What is the difference between a Jenkins job and a pipeline?
a. A job does not require scripting whereas a pipeline requires scripting.
b. A job requires scripting whereas a pipeline does not require scripting.
c. There is no difference.
d. A job is a schedule or trigger assigned to a pipeline.
e. None of the above.
a. A job does not require scripting whereas a pipeline requires scripting.
What is the purpose of Liquibase?
a. Database/schema refactoring
b. RESTful service development
c. Docker container orchestration platform
d. Authentication
e. None of the above
a. Database/schema refactoring
What is DevOps?
a. DevOps is the union of People, Process, and Tools to enable continuous
delivery of value to our end users
b. DevOps is a programming language
c. DevOps is operational staff doing development work
d. DevOps is a software development model
e. None of the above
a. DevOps is the union of People, Process, and Tools to enable continuous delivery of value to our end users.
What are the parts of JSON Web Tokens?
a. Header, Payload, Signature
b. Header, Payload, Attachment, Signature
c. Header, Payload, Signature, Attachments
d. Payload, Signature
e. None of the above
a. Header, Payload, Signature
Which of the following commands runs Jenkins from the command line?
a. java -jar jenkins.war
b. java -war jenkins.war
c. java -jar jenkins.jar
d. java -war jenkins.jar
e. None of the above
a. java -jar jenkins.war
To build RESTful web services, we need to add the following dependencies.
Select the correct dependencies.
a. spring-boot-starter-web
b. spring-boot-starter-rest
c. spring-boot-starter-web.rest
d. All the above
e. None of the above
a. spring-boot-starter-web
Given a REST service that returns information about orders, including the
various items of each order, what might the URI look like for getting the second
item of the first order?
a. /orders3items2
b. /orders/1/items/2
c. /orders/2/items/3
d. /orders/3/items/2
e. None of the above
b. /orders/1/items/2