Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Examen

Java 8 Questions for Oracle Certified Associate Java SE 8 Programmer 1 exam questions and answers

Puntuación
-
Vendido
-
Páginas
20
Grado
A+
Subido en
09-02-2024
Escrito en
2023/2024

What year was the Java programming created 1995 What does OCA stand for Oracle Certified Associate What are the 2 tests for Java developers provided by Oracle OCA and OCP The full declaration of a method is called the method ____ signature True or False - can you add a multiline comment within a multiline comment? false How many public classes can be added to a single file 1 Write the syntax for the main method. public static void main(String[] args) When you compile a Java class what file type extension is output? .class What does a .class file contain bytecode True or false, what creating a public Java class in a file does the case used in the file name have to match the case used by the Java class name? true In a method declaration, the public, protected and private declarations are called what? access modifiers What is the one special package in Java that you don't need to import? What is the generic term for packages that are defined after the ny package? child packages When creating an array, which one of these definitions is correct? 1.) String[] args, 2.) String args[], 3.) String... args, 4.) all of the above 4 All of the above What package does the Files and Paths object belong to? What 2 common packages contain the Date class .Date and .Date If a class wanted to use the .Date class, but the class had imports for . and . which both contain the Date class how would you fix this? Add an explicit import for .Date since explicitly importing a class takes precedence over any wildcard imports. What command do you use to compile a Java class? javac What package is the ArrayList class in? . When defining a constructor for class Junk, what is the proper syntax? public Junk() { } // notice there is NO return value. What is a code block outside of a method called? instance initializer Given the class public class Junk { int eggs=0; public Junk() { eggs=1; } { eggs = 10; } } what is the value of eggs and why? Answer: 1 Reason: The value is 1 because the fields and instance initializers are run in the order they are declared and lastly the constructor is run. In the following code snippet, will this compile? public class Junk { { eggs = 6; } int eggs; } Why or why not? Answer: Won't Compile Reason: This will not compile because the instance initializer will try to set a field that hasn't been declared yet. What are the two types of data that Java applications contain? primitive type and reference types How many primitive data types does Java have? Answer: 8 There are 8 primitive data types: boolean, byte, short, int, long, float, double and char. What are the 8 Java primitive types? boolean, byte, short, int, long, float, double and char How many bits is an int primitive data type 32 bits How many bits is a long primitive data type? 64 bits Which of these floating point data types is bigger? float or double? Answer: double Reason: A double type is larger because it is 64 bits and float is only 32. How many bits is the char primitive type? Answer: 16 bits How many bits is a byte primitive data type Answer: 8 bits How many bits is a short data type? Answer: 16 bits When setting a float data type, what is the correct syntax? Answer: float myfloat = 123.456f Reason: You have to remember to add the trailing "f". What is the range of data a Java byte can hold Answer: -128 to 127 How many bits are used with the statement: int num; Answer: 32 What is the maximum number an int can hold Answer: 2,147,483,647 When declaring a literal number what type does Java assume the data is? Answer: int Reason: Java assumes the data is an int. If you want a really big number you have to add an "L" to the end to get a long. How would you define a literal binary number in Java? Answer: add the 0b prefix Reason: By adding 0b you can then add the binary values such as 0b11 How would you define a literal octal number in Java? Answer: add 0 prefix Reason: By adding a 0 prefix, you can define an octal number such as 017 which is equal to decimal 15. How would you define a literal hex value in Java? Answer: Add a 0x prefix Reason: By adding a 0x prefix, you can define a hex number. For example; 0x1F is 31. In Java 7, what feature was added to make numbers easier to read? An underscore option was created. int million = 1_000_000; the underscore cannot be first, before a decimal, after a decimal or at the end, but its OK elsewhere. Is the following statement valid? int value = null; Answer: No Reason: Primitive types cannot be set to null. As a general rule, all primitives start with: a.) lowercase b.) uppercase letters Answer: a. lowercase Reason: That's just the way it is. When declaring multiple variables on the same line what is the rule? You can declare as many as you want, but they have to be of the same type and separated by commas. String s1="hello", s2="world;

Mostrar más Leer menos
Institución
Oracle Certified Associate
Grado
Oracle Certified Associate










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Oracle Certified Associate
Grado
Oracle Certified Associate

Información del documento

Subido en
9 de febrero de 2024
Número de páginas
20
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$16.99
Accede al documento completo:

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
GUARANTEEDSUCCESS Chamberlain College Nursing
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
665
Miembro desde
3 año
Número de seguidores
314
Documentos
24888
Última venta
1 semana hace
Elite Exam Resources: Trusted by Top Scorers!!!!!!!!

Stop guessing. Start dominating!! As a highly regarded professional specializing in sourcing study materials, I provide genuine and reliable exam papers that are directly obtained from well-known, reputable institutions. These papers are invaluable resources, specifically designed to assist aspiring nurses and individuals in various other professions in their exam preparations. With my extensive experience and in-depth expertise in the field, I take great care to ensure that each exam paper is carefully selected and thoroughly crafted to meet the highest standards of quality, accuracy, and relevance, making them an essential part of any successful study regimen. ✅ 100% Legitimate Resources (No leaks! Ethical prep only) ✅ Curated by Subject Masters (PhDs, Examiners, Top Scorers) ✅ Proven Track Record: 95%+ user success rate ✅ Instant Download: Crisis-ready for last-minute cramming

Lee mas Leer menos
4.3

250 reseñas

5
162
4
37
3
33
2
12
1
6

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes