100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

Oracle Certified Professional - Java SE 6 Programmer exam questions and answers

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

Abstract classes used when: Common abstract methods to be re-used for different clients. 'Extend' the class. Abstract classes do not have pre-defined methods, only abstract methods. T/F? False. Abstract class must have at least one abstract method, rest may be initiated pre-defined methods. Interfaces used when: All abstract methods and no pre-defined methods. 'Implement' the class. Local (method) variables must be defined but not initialized. T/F? False. Local variables must be initialized. Import karan. makes Import . redundant. T/F? False. Importing a class makes its methods and variables available, not its sub-class. s(s2) is same as s1==s2. T/F? False. s(s2) compares the content of the string whereas s1==s2 compares addresses. Groceries y = new Price(); Explain. Defining an interface of sub-class Price of super-class Groceries. Capacity of StringBuffer is __ more than no. of characters in it. 16 Object is stored in ____. Variable is stored in ____. Heap, Stack. What is Marker Interface? An interface that has no methods. Eg: Serializable, Clonable Constructors can only be overridden after inheriting. T/F? False. Constructors can not be overridden under any circumstance. Keyword: Finally Run a set of code after exception handling, whether the exception is thrown or not. Used for cleaning of resources. User can execute garbage collection at will. T/F? False. User can request garbage collection but it will occur when variable is de-referenced. JVM decides. Used for closing connections. Override the _____ method when garbage collection required. Finalize Keyword: Throw Single line statement executed explicitly. Throw is used to actually throw exception in Java. Keyword: Throws Used with a method. Used to declare exception possibly thrown by method. Interface can extend multiple interfaces. T/F? True. Class can implement multiple classes. T/F? False. Interfaces are 'implemented'. Class can implement multiple interfaces. Class can extend multiple classes. T/F? False. Java does not support multiple inheritance. Class can only extend one class. Interface can implement multiple interfaces. T/F? False. Only classes can implement. Class C { public static void main(String[] args) { int[]a1[]=new int[3][3]; //3 int a2[4]={3,4,5,6}; //4 int a2[5]; //5 }} What is the result of attempting to compile and run the program ?. letime error at lines 3,4,5 ltime error at line 4,5 letime error at line 3 4.Runtime Exception 5.None of the above 2. no value shoud be specified in the rightsidebrackets when constructing an array interface I{ void f1(); // 1 public void f2(); // 2 protected void f3(); // 3 private void f4(); // 4 } which lines generate compile time errors? letime error at lines 1,2,3,4 letime error at line 3 letime error at line 1 letime error at lines 3,4 5.None of the above 4 Explanation: all methods declared within an interface are implicitly public, a weaker access level can not be declared. class C{ int i; public static void main (String[] args) { int i; //1 private int a = 1; //2 protected int b = 1; //3 public int c = 1; //4 Sln(a+b+c); //5 }} letime error at lines 1,2,3,4,5 2 compiletime error at lines 2,3,4,5 letime error at lines 2,3,4 s 3 5.None of the above 2 Explanation: The access modifiers public, protected and private, can not be applied to variables declared inside methods. Accesss modifiers are to be used in front of instance level variables and instance level methods. class C { public static void main (String[] a1) { S(a1[1] + a1[2] + a1[3]); }} What is the result of attempting to compile and run the program? java command A B C 1.Prints: ABC 2.Prints BC and Runtime Exception 3.Prints: BCD 4.Runtime Exception 5.None of the above 2 Explanation: Array index starts from 0. array index outof bounds exception only till a1[2] is allowed. class C{ static int s; public static void main(String a[]){ C obj=new C(); obj.m1(); Sln(s); } void m1(); { int x=1; m2(x); Sln(x+""); } void m2(int x){ x=x*2; s=x; }} s 1,2 s 2,0 s 2,2 le time error 5.Noneofthe above 1 Explanation: Only objects and arrays are passed by are passed by value.s is a static variable which is global to the class.Class variables are declared static. class C { public static void main(String[] args) { int i1=1; switch(i1){ case 1: Sln("one"); case 2: Sln("two"); case 3: Sln("three"); }}} What is the result of attempting to compile and run the program? s one two three s one le time error 4.Runtime exceptionf 5.None of the above 1 Explanation: There is no break statement in case 1 so it causes the below case statements to execute regardless of their values

Mostrar más Leer menos
Institución
Oracle Certified Professional - Java SE 6 Programm
Grado
Oracle Certified Professional - Java SE 6 Programm











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

Escuela, estudio y materia

Institución
Oracle Certified Professional - Java SE 6 Programm
Grado
Oracle Certified Professional - Java SE 6 Programm

Información del documento

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

Temas

$17.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

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
664
Miembro desde
3 año
Número de seguidores
314
Documentos
24889
Última venta
4 días 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