SlideShare a Scribd company logo
1 of 5
Multiple Choice
1) What is an abstract function?
A. A function that can be overridden in an inheriting class
B. A function that has no side-effects
C. A function with no implementation that must be overridden by inheriting classes



2) What is the difference between Stack and Queue?
A. A stack is a Last In First Out (LIFO) data structure, while a Queue is a First In First Out (FIFO)
data structure
B. A stack is made up of a linear array of values, while a Queue is made up of a linked list of ob-
jects
C. They are the same, except that a stack can be larger



3) What does the final declaration mean for a class?
A. It cannot be directly instantiated.
B. It cannot be subclassed.
C. It cannot have a superclass.


4) Which package is implicitly imported for all java classes?
A. java.io
B. java.util
C. java.lang



5) For the definition:

public class someclass
{
    int m_var;
}

a) What is the visibility of m_var to another class in the same package?

A. Private
B. Protected
C. Public



b) What is the visibility of m_var to another class in a different package?

A. Private
B. Protected
C. Public
c) What is the visibility of m_var to a subclass in a different package?

A. Private
B. Protected
C. Public



6) How many bytes are used by a Java long primitive?

A. It is compiler dependent
B. 4
C. 8
D. 64



7) Which keyword is used on a method to indicate that only a single thread at a time
should execute the method?

A. volatile
B. synchronized
C. transient
D. static



8) Consider the code below. Select the answers that correspond to the output of
running this class.
    public class test {
        public static void main(String args[]) {
            int i=1, j=1;
            try {
                i++;
                j--;
                if(i/j > 1)
                     i++;
            }
            catch(ArithmeticException e) {
                System.out.println(0);
            }
            catch(ArrayIndexOutOfBoundsException e) {
                System.out.println(1);
            }
            catch(Exception e) {
                System.out.println(2);
            }
            finally {
                System.out.println(3);
            }
            System.out.println(4);
         }
    }
A.4
   B.3
   C.2
   D.1
   E.0



9) J2EE servlets and jsp files are normally packaged into which type of archive?
A. WAR
B. EAR
C. JAR
D. ZIP



10) Which of the following are features of EJB3.0?
         1. Written as POJOs
         2. Supports Java Persistence API
         3. Requires deployment descriptors
         4. Uses annotations

   A.1,2 and 3
   B.1,2 and 4
   C.All of the above



Short Answer
Question #1:

Outline the main differences between J2EE and J2SE. Give an example of a type of ap-
plication where J2EE would be used.


Question #2:

Describe the use of a particular design pattern in a previous project. Do you feel that a
"pattern oriented" design philosophy is useful? Does the use of patterns result in better
software?
Question #3:

Explain the purpose of using interfaces in java. Show a simple example that makes use
of an interface.


Question #4:

Briefly describe java reflection and what it is used for. Also, explain the difference be-
tween this and how EJBs are used.


Question #5:

Explain the difference between local and remote interfaces and when each would be
used.



Question #6:
Explain why we cannot declare a constructor as final?



Question #7:
What is the difference between == and equals() ?



Question #8:
Java has a garbage collector so why would you need the finalize() method for? Any Ex-
ample?



Question #9:
What is wrong with the following code. What would be a way to fix it?

class A {
static Vector quad[][];
....
public A(){
        int row =50;
        int col = 100;
        Vector quad[][] = new Vector[row][col];
        for ( int i =0; i < row; i++ )
        for ( int j =0; j < row; j++ )
        quad[i][j] = new Vector(0,1);
}
public int size(){
return quad.length;
}
}


Question #10:
A server generates weather forecast maps, a cache is implemented so maps are not re-
generated for the same region, the cache uses the local file system to store the maps ?
What could be the issue if the application is deployed on a cluster of machines? What
solution could you suggest?




Question #11:
Describe your techniques for prevent bugs when writing code?

More Related Content

What's hot

9781111530532 ppt ch10
9781111530532 ppt ch109781111530532 ppt ch10
9781111530532 ppt ch10
Terry Yoast
 
9781111530532 ppt ch11
9781111530532 ppt ch119781111530532 ppt ch11
9781111530532 ppt ch11
Terry Yoast
 

What's hot (17)

Ppl home assignment_unit3
Ppl home assignment_unit3Ppl home assignment_unit3
Ppl home assignment_unit3
 
Interface in java
Interface in javaInterface in java
Interface in java
 
Poster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default MethodsPoster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default Methods
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
 
Java interface
Java interfaceJava interface
Java interface
 
Hemajava
HemajavaHemajava
Hemajava
 
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
 
C#
C#C#
C#
 
9781111530532 ppt ch10
9781111530532 ppt ch109781111530532 ppt ch10
9781111530532 ppt ch10
 
Lecture 8 abstract class and interface
Lecture   8 abstract class and interfaceLecture   8 abstract class and interface
Lecture 8 abstract class and interface
 
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMUAutomated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
 
C# interview quesions
C# interview quesionsC# interview quesions
C# interview quesions
 
ICOM4015 CIIC4010 Exam Review #1
ICOM4015 CIIC4010 Exam Review #1 ICOM4015 CIIC4010 Exam Review #1
ICOM4015 CIIC4010 Exam Review #1
 
Computer programming 2 Lesson 15
Computer programming 2  Lesson 15Computer programming 2  Lesson 15
Computer programming 2 Lesson 15
 
9781111530532 ppt ch11
9781111530532 ppt ch119781111530532 ppt ch11
9781111530532 ppt ch11
 
Friend function & friend class
Friend function & friend classFriend function & friend class
Friend function & friend class
 

Similar to MX Server is my friend

Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paper
fntsofttech
 
Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02
Kumaran K
 
Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02
lakk1234
 

Similar to MX Server is my friend (20)

sample_midterm.pdf
sample_midterm.pdfsample_midterm.pdf
sample_midterm.pdf
 
Simulado java se 7 programmer
Simulado java se 7 programmerSimulado java se 7 programmer
Simulado java se 7 programmer
 
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
 
Conceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a ObjetosConceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a Objetos
 
Questões de Certificação SCJP
Questões de Certificação SCJPQuestões de Certificação SCJP
Questões de Certificação SCJP
 
Cse java
Cse javaCse java
Cse java
 
Java interview questions 2
Java interview questions 2Java interview questions 2
Java interview questions 2
 
Multiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritanceMultiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritance
 
ITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptx
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paper
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
DAY_1.1.pptx
DAY_1.1.pptxDAY_1.1.pptx
DAY_1.1.pptx
 
01 Java Language And OOP Part I LAB
01 Java Language And OOP Part I LAB01 Java Language And OOP Part I LAB
01 Java Language And OOP Part I LAB
 
oops with java modules i & ii.ppt
oops with java modules i & ii.pptoops with java modules i & ii.ppt
oops with java modules i & ii.ppt
 
Java Programming.pdf
Java Programming.pdfJava Programming.pdf
Java Programming.pdf
 
Java Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRaoJava Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRao
 
Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02
 
Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02
 
1_JavIntro
1_JavIntro1_JavIntro
1_JavIntro
 
Java programming-examples
Java programming-examplesJava programming-examples
Java programming-examples
 

More from Gabriel Daty (20)

test(1)
test(1)test(1)
test(1)
 
hello
hellohello
hello
 
Manitoba
ManitobaManitoba
Manitoba
 
Manitoba
ManitobaManitoba
Manitoba
 
Manitoba
ManitobaManitoba
Manitoba
 
Manitoba
ManitobaManitoba
Manitoba
 
Manitoba
ManitobaManitoba
Manitoba
 
example_file_x
example_file_xexample_file_x
example_file_x
 
example_file_x
example_file_xexample_file_x
example_file_x
 
Manitoba
ManitobaManitoba
Manitoba
 
Manitoba
ManitobaManitoba
Manitoba
 
Manitoba
ManitobaManitoba
Manitoba
 
example_file_x
example_file_xexample_file_x
example_file_x
 
example_file_x
example_file_xexample_file_x
example_file_x
 
example_file_x
example_file_xexample_file_x
example_file_x
 
example_file_x
example_file_xexample_file_x
example_file_x
 
example_file_x
example_file_xexample_file_x
example_file_x
 
Manitoba
ManitobaManitoba
Manitoba
 
example_file_x
example_file_xexample_file_x
example_file_x
 
Manitoba
ManitobaManitoba
Manitoba
 

MX Server is my friend

  • 1. Multiple Choice 1) What is an abstract function? A. A function that can be overridden in an inheriting class B. A function that has no side-effects C. A function with no implementation that must be overridden by inheriting classes 2) What is the difference between Stack and Queue? A. A stack is a Last In First Out (LIFO) data structure, while a Queue is a First In First Out (FIFO) data structure B. A stack is made up of a linear array of values, while a Queue is made up of a linked list of ob- jects C. They are the same, except that a stack can be larger 3) What does the final declaration mean for a class? A. It cannot be directly instantiated. B. It cannot be subclassed. C. It cannot have a superclass. 4) Which package is implicitly imported for all java classes? A. java.io B. java.util C. java.lang 5) For the definition: public class someclass { int m_var; } a) What is the visibility of m_var to another class in the same package? A. Private B. Protected C. Public b) What is the visibility of m_var to another class in a different package? A. Private B. Protected C. Public
  • 2. c) What is the visibility of m_var to a subclass in a different package? A. Private B. Protected C. Public 6) How many bytes are used by a Java long primitive? A. It is compiler dependent B. 4 C. 8 D. 64 7) Which keyword is used on a method to indicate that only a single thread at a time should execute the method? A. volatile B. synchronized C. transient D. static 8) Consider the code below. Select the answers that correspond to the output of running this class. public class test { public static void main(String args[]) { int i=1, j=1; try { i++; j--; if(i/j > 1) i++; } catch(ArithmeticException e) { System.out.println(0); } catch(ArrayIndexOutOfBoundsException e) { System.out.println(1); } catch(Exception e) { System.out.println(2); } finally { System.out.println(3); } System.out.println(4); } }
  • 3. A.4 B.3 C.2 D.1 E.0 9) J2EE servlets and jsp files are normally packaged into which type of archive? A. WAR B. EAR C. JAR D. ZIP 10) Which of the following are features of EJB3.0? 1. Written as POJOs 2. Supports Java Persistence API 3. Requires deployment descriptors 4. Uses annotations A.1,2 and 3 B.1,2 and 4 C.All of the above Short Answer Question #1: Outline the main differences between J2EE and J2SE. Give an example of a type of ap- plication where J2EE would be used. Question #2: Describe the use of a particular design pattern in a previous project. Do you feel that a "pattern oriented" design philosophy is useful? Does the use of patterns result in better software?
  • 4. Question #3: Explain the purpose of using interfaces in java. Show a simple example that makes use of an interface. Question #4: Briefly describe java reflection and what it is used for. Also, explain the difference be- tween this and how EJBs are used. Question #5: Explain the difference between local and remote interfaces and when each would be used. Question #6: Explain why we cannot declare a constructor as final? Question #7: What is the difference between == and equals() ? Question #8: Java has a garbage collector so why would you need the finalize() method for? Any Ex- ample? Question #9: What is wrong with the following code. What would be a way to fix it? class A { static Vector quad[][]; .... public A(){ int row =50; int col = 100; Vector quad[][] = new Vector[row][col]; for ( int i =0; i < row; i++ ) for ( int j =0; j < row; j++ ) quad[i][j] = new Vector(0,1); } public int size(){
  • 5. return quad.length; } } Question #10: A server generates weather forecast maps, a cache is implemented so maps are not re- generated for the same region, the cache uses the local file system to store the maps ? What could be the issue if the application is deployed on a cluster of machines? What solution could you suggest? Question #11: Describe your techniques for prevent bugs when writing code?