Friday, October 26, 2007

Java interview questions Part30


1. What do you understand by UML. How to interpret UML diagrams?
2. State the effect of encapsulation, inheritance, and use of interfaces on architectural characteristics?
3. Differentiate between 2 tier, 3 tier and n-tier architectures.
4. How do the following characteristics scalability,performance, high availabilty behave based on the above architecture selected.
5. In what all ways (methods/concepts) can we achieve integration with legacy/n-n-legacy applications using JAVA technologies.
6. List the required classes/interfaces that must be provided for an EJB technology.
7. Distinguish stateful and stateless Session beans.
8. Distinguish Session and Entity beans.
7.
Using the fewest fragments possible (and filling the fewest slots possible), complete the code below so that the class builds a directory named "dir3" and creates a file named "file3" inside "dir3". Note you can use each fragment either zero or one times.

Code:

import java.io.________________

class Maker {
public static void main(String [] args) {
___________ ___________ ___________
___________ ___________ ___________
___________ ___________ ___________
___________ ___________ ___________
___________ ___________ ___________
___________ ___________ ___________
___________ ___________ ___________
}
}

Fragments:

File; FileDescriptor; FileWriter; Directory;
try { .createNewDir(); File dir File
{ } (Exception x) ("dir3"); file
file .createNewFile(); = new File = new File
dir (dir, "file3"); (dir, file); .createFile() ;
} catch ("dir3", "file3"); .mkdir(); File file



8.
Which are true? (Choose all that apply.)

The DateFormat.getDate() is used to convert a String to a Date instance.

Both DateFormat and NumberFormat objects can be constructed to be Locale specific.

Both Currency and NumberFormat objects must be constructed using static methods.

If a NumberFormat instance's Locale is to be different than the current Locale, it must be specified at creation time.

A single instance of NumberFormat can be used to create Number objects from Strings and to create formatted numbers from numbers.


9.
Which will compile and run without exception? (Choose all that apply.)

System.out.format("%b", 123);

System.out.format("%c", "x");

System.out.printf("%d", 123);

System.out.printf("%f", 123);

System.out.printf("%d", 123.45);

System out. printf ("%f", 123.45);

System.out.format("%s", new Long("123"));


10.
Which about the three java.lang classes String, StringBuilder, and StringBuffer are true? (Choose all that apply.)

All three classes have a length() method.

Objects of type StringBuffer are thread-safe.

All three classes have overloaded append() methods.

The "+" is an overloaded operator for all three classes.

According to the API, StringBuffer will be faster than StringBuilder under most implementations.

The value of an instance of any of these three types can be modified through various methods in the API.

0 comments:

Advertisement

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com