Owner: IT Interview Questions URL:http://www.itinterviewquestion.com/ Join Date: Wed, 14 Nov 2007 02:48:21 -0600 Rating:0 Site Description: Tech Interview Questions | .Net Interview Questions | Java Interview questions | Testing Tools Interview questions | Database Interview Questions | Resume Writing | Resume Tips | Testing tools Interview questions | Candidate Interview Questions | IT inter Site statistics:Click here
SCJP Interview Questions Part7 2008-05-13 04:02:22 QUESTION NO: 101
Which statement is true?
A. The Error class is a untimeException.
B. No exceptions are subclasses of Error.
C. Any statement that may throw an Error must be enclosed in a try block.
D. Any statement that may throw an Exception must be enclosed in a try block.
E. Any statement that may thro a runtimeException must be [...]
SCJP Interview Questions Part6 2008-05-13 03:50:46 QUESTION NO: 81
Which determines if “prefs” is a directory and exists on the file system?
A. Boolean exists=Directory.exists (”prefs”);
B. Boolean exists=(new File(”prefs”)).isDir();
C. Boolean exists=(new Directory(”prefs”)).exists();
D. Boolean exists=(new File(”prefs”)).isDirectory(); E. Boolean exists=true; Try{
Directory d = new Dire
SCJP Interview Questions and Answers 2008-05-13 03:41:42 QUESTION NO: 61
Exhibit
1. public class SyncTest{
2. public static void main(String[] args) {
3. final StringBuffer s1= new StringBuffer();
4. final StringBuffer s2= new StringBuffer();
5. new Thread () {
6. public void run() {
7. synchronized(s1) {
8. s2.append(”A”);
9. synchronized(s2) {
10. s2.append(”B”);
11. System.out.print(s1);
12. System.out.print(s2);
13. }
14. }
1
SCJP Interview Questions Part5 2008-05-13 03:27:59 Question No 46
Given:
1. public class IfTest (
2. public static void main(string[]args) {
3. int x = 3;
4. int y = 1;
5. if (x = y)
6. system.out.printIn(”Not equal”); 7. else
8. system.out.printIn(”Equal”);
9. }
10. )
What is the result?
A. The output is “Equal”
B. The output in “Not Equal”
C. An error at line 5 causes compilation to fall.
D. The pr
SCJP Interview Questions Part4 2008-05-13 03:16:07 Question No 32
Given the ActionEvent, which method allows you to identify the affected component?
A. GetClass.
B. GetTarget.
C. GetSource.
D. GetComponent.
E. GetTargetComponent.
Answer: C
Question No 33
Which is a method of the MouseMotionListener interface?
A. Public void mouseMoved(MouseEvent)
B. Public boolean mouseMoved(MouseEvent)
C. Public void mouseMoved(MouseMotionEvent)
D. Public boolean
SCJP Interview Questions Part 3 2008-05-13 03:06:55 Question No 22
Given:
1. public class foo {
2. public static void main (String[]args) {
3. String s;
4. system.out.printIn (”s=” + s);
5. }
6. }
What is the result?
A. The code compiles and “s=” is printed.
B. The code compiles and “s=null” is printed.
C. The code does not compile because string s is not initialized.
D. The code does not compile because [...]
SCJP Interview Questions 2008-05-13 02:11:11 Question No: 11
Which two demonstrate an “is a” relationship? (Choose Two)
A. public interface Person { } public class Employee extends Person { }
B. public interface Shape { } public class Employee extends Shape { }
C. public interface Color { } public class Employee extends Color { }
D. public class Species { } public class Animal [...]
SCJP Interview Questions 2008-05-13 01:59:53 Question No: 1
Given:
1. public class test (
2. public static void main (String args[]) {
3. int i = 0xFFFFFFF1;
4. int j = ~i;
5. }
7. )
What is the decimal value of j at line 5?
A. 0
B. 1
C. 14
D. 15
E. An error at line 3 causes compilation to fail.
F. An error at line 4 causes compilation to fail.
Answer: [...]
SCJP Interview Questions 2008-06-04 13:12:31 QUESTION NO 135
Given:
1. public class Foo implements Runnable (
2. public void run (Thread t) {
3. system.out.printIn(”Running.”);
4. }
5. public static void main (String[] args) {
6. new thread (new Foo()).start();
7. )
8. )
What is the result?
A. An exception is thrown. B. The program exists without printing anything.
C. An error at line 1 causes compilation to fail. D. An [...]
SCJP Interview Questions 2008-06-04 13:01:57 QUESTION NO 129
Which two create an instance of an array? (Choose Two)
A. int[] ia = new int [15]; B. float fa = new float [20]; C. char[] ca = “Some String”; D. Object oa = new float[20];
E. Int ia [][] = (4, 5, 6) (1, 2, 3)
Answer: A, D
QUESTION NO 130
Given:
1. public class ExceptionTest {
2. [...]
SCJP Interview Questions 2008-06-04 13:00:30 QUESTION NO 122
How can you create a listener class that receives events when the mouse is moved?
A. By extending MouseListener. B. By implementing MouseListener. C. By extending MouseMotionListener. D. By implementing MouseMotionListener. E. Either by extending MouseMotionListener or extending MouseListener. F. Either by implementing MouseMotion Listener or implementing MouseListener.
Answer: D
SCJP Interview Questions 2008-06-04 12:56:34 QUESTION NO 117
Given:
1. public class Foo {
2. public void main (String [] args) {
3. system.out.printIn(”Hello World.”);
4. }
5. }
What is the result?
A. An exception is thrown. B. The code does no compile. C. “Hello World.” Is printed to the terminal. D. The program exits without printing anything.
Answer: A
QUESTION NO 118
Given:
1. //point X
2. public class foo (
3. [.
SCJP Interview Questions 2008-06-04 12:50:22 QUESTION NO: 103
Given:
1. switch (i) {
2. default:
3. System.out.printIn(”Hello”);
4. )
What is the acceptable type for the variable i?
A. Byte
B. Long
C. Float
D. Double
E. Object
F. A and B G. C and D
Answer: A
QUESTION NO: 104
You need to store elements in a collection that guarantees that no duplicates are stored. Which two
interfaces provide that capability? (Choose Two)
A. Java.
SCJP Interview Questions 2008-06-04 12:48:46 QUESTION NO: 97
Exhibit:
1. public class X {
2. public static void main (String[]args) {
3. int [] a = new int [1]
4. modify(a);
5. System.out.printIn(a[0]);
6. }
7. 8. public static void modify (int[] a) {
9. a[0] ++;
10. }
11. }
What is the result?
A. The program runs and prints “0″ B. The program runs and prints “1″ C. The program runs [...]
SCJP Interview Questions 2008-06-04 12:45:47 QUESTION NO: 91
Which two valid declarations of a char? (Choose Two)
A. Char ch = “a”; B. Char ch = `\’ `; C. Char ch = `cafe’; D. Char ch = “cafe”; E. Char ch = `\ucafe’; F. Char ch = `\u10100′; G. Char ch = (char) true;
Answer: B, E
QUESTION NO: 92
Given:
1. String foo = “blue”;
2. [...]
SCJP Interview Questions 2008-06-04 12:44:45 QUESTION NO: 80
Given:
1. public abstract class Test {
2. public abstract void methodA();
3.
4. public abstract void methodB()
5. {
6. System.out.printIn(”Hello”);
7. }
8. }
Which three changes (made independently) allow the code to compile? (Choose Three)
A. Add a method body to methodA. B. Replace lines 5-7 with a semicolon (”.”) C. Remove the abstract qualifier from the
Sun Certified Java Interview Questions 2008-06-04 12:41:58 QUESTION NO: 61
Exhibit
1. public class SyncTest{
2. public static void main(String[] args) {
3. final StringBuffer s1= new StringBuffer();
4. final StringBuffer s2= new StringBuffer();
5. new Thread () {
6. public void run() {
7. synchronized(s1) {
8. s2.append(”A”);
9. synchronized(s2) {
10. s2.append(”B”);
11. System.out.print(s1);
12. System.out.print(s2);
13. }
14. }
1 Read more:Certified
C++ Interview Questions 2008-07-28 14:49:47 What is encapsulation??
Containing and hiding information about an object, such as internal data structures and code. Encapsulation isolates the internal complexity of an object’s operation from the rest of the application. For example, a client component asking for net revenue from a business object need not know the data’s origin.
What is inheritance?
Inheritance allows one class [...]
C++ Interview Questions & Answers2 2008-07-28 14:44:57 What are storage qualifiers in C++ ?
They are..
const
volatile
mutable
Const keyword indicates that memory once initialized, should not be altered by a program.
volatile keyword indicates that the value in the memory location can be altered even though nothing in the program
code modifies the contents. for example if you have a pointer to hardware location that contains the [...]
C++ Interview Questions & Answers1 2008-07-28 12:36:23 What problem does the namespace feature solve?
Multiple providers of libraries might use common global identifiers causing a name collision when an application tries to link with two or more such libraries. The namespace feature surrounds a library’s external declarations with a unique namespace that eliminates the potential for those collisions.
namespace [identifier] { namespace-body }
A names
C++ Interview Questions & Answers 2008-07-28 12:30:49 What is “this” pointer?
The this pointer is a pointer accessible only within the member functions of a class, struct, or union type. It points to the object for which the member function is called. Static member functions do not have a this pointer.
When a nonstatic member function is called for an object, the address of [...]
C++ Interview Questions 2008-07-28 12:25:02 Could you tell something about the Unix System Kernel?
The kernel is the heart of the UNIX openrating system, it’s reponsible for controlling the computer’s resouces and scheduling user jobs so that each one gets its fair share of resources.
What is a Make file?
Make file is a utility in Unix to help compile large programs. It [...]
Unix Concepts Interview Questions2 2008-08-05 13:43:28 1. How the Kernel handles the copy on write bit of a page, when the bit is set?
In situations like, where the copy on write bit of a page is set and that page is shared by more than one process, the [...] Read more:Concepts
Unix Concepts Interview Questions1 2008-08-05 13:41:33 1. Difference between the fork() and vfork() system call?
During the fork() system call the Kernel makes a copy of the parent process’s address space and attaches it to the child process.
But the vfork() system call do [...] Read more:Concepts
Unix Concepts Interview Questions 2008-08-05 13:32:25 1. How the Swapper works?
The swapper is the only process that swaps the processes. The Swapper operates only in the Kernel mode and it does not uses System calls instead it uses internal Kernel functions for swapping. It is the archetype of all [...] Read more:Concepts
Unix Memory Management Interview Questions 2008-08-05 13:25:32 1. What is the difference between Swapping and Paging?
Swapping:
Whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and overhead to the system. Swapping systems does not [...] Read more:Memory
, Management
Unix Process Model and IPC Interview Questions 2008-08-05 13:06:43 1.Brief about the initial process sequence while the system boots up.
While booting, special process called the ’swapper’ or ’scheduler’ is created with Process
-ID 0. The swapper manages memory allocation for processes and influences CPU allocation. The swapper inturn creates 3 children:
Ø the process dispatcher,
Ø vhand [...]
Unix File Management Interview Questions 2008-08-05 11:11:47 1.How are devices represented in UNIX?
All devices are represented by files called special files that are located in/dev directory. Thus, device files and other files are named and accessed in the same way. A ‘regular file’ is just an ordinary data file in the disk. A ‘block special file’ represents a device with characteristics similar [...] Read more:Management
SQL Queries Interview Questions2 2008-08-19 13:59:37 1.SELECT DISTINCT(A.ENAME) FROM EMP A, EMP B WHERE A.EMPNO = B.MGR; or SELECT ENAME FROM EMP WHERE EMPNO IN (SELECT MGR FROM EMP);
2.SELECT * FROM EMP WHERE DEPTNO IN (SELECT DEPTNO FROM EMP GROUP BY DEPTNO HAVING COUNT(EMPNO)>10 AND DEPTNO=10);
3.SELECT A.ENAME “EMPLOYEE”, B.ENAME “REPORTS TO” FROM EMP A, EMP B WHERE A.MGR=B.EMPNO;
4.SELECT [...] Read more:SQL
, Queries
SQL Queries Interview Questions1 2008-08-19 13:56:45 II . SCHEMA :
Table 1 : DEPT
DEPTNO (NOT NULL , NUMBER(2)), DNAME (VARCHAR2(14)), LOC (VARCHAR2(13)
Table 2 : EMP
EMPNO (NOT NULL , NUMBER(4)), ENAME (VARCHAR2(10)),JOB (VARCHAR2(9)), MGR (NUMBER(4)), HIREDATE (DATE), SAL (NUMBER(7,2)), COMM (NUMBER(7,2)), DEPTNO (NUMBER(2))
MGR is the empno of the employee whom the employee reports to. DEPTNO is a foreign [...] Read more:SQL
, Queries