Java interview questions



Share on Google+Share on Google+

Janardhan yadav
Java interview questions
1 Answer(s)      6 years and 4 months ago
Posted in : Java Interview Questions

Plz answer the following questions.....

  1. The type long can be used to store values in the following range: a. -263 to 263 - 1 b. -231 to 231 - 1 c. -264 to 264 d. -232 to 232 - 1

  2. Which of the following is not a hexadecimal number? (A) 999 (B) (hex)23 (C) 0x556 (D) 0x1F2

a. (A) b. (A) & (B) c. (C) d. (A), (B) & (C)

  1. Select the invalid assignment statements from the following: (A) float x = 238.88; (B) double y = 0x443; a. (B) b. (B) & (D) c.(A) & (B) d.(A) & (C)

  2. If not assigned a value, a variable of type char has the following default value: a. '\uffff' b. " " (space) c. '\u0001' d. '\u0000'

  3. 15 & 29 = ? a. 44 b. 14 c. 13 d. 12

  4. 27 | 8 = ? a. 8 b. 27 c. 19 d. 35

  5. Identify the statements that are correct: (A) int a = 13, a>>2 = 3 (B) int b = -8, b>>1 = -4 (C) int a = 13, a>>>2 = 3 (D) int b = -8, b>>>1 = -4

a. (A), (B), (C) & (D) b. (A) & (B) c. (C) & (D) d. (A), (B) & (C)

  1. Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what will be the values of x, y and z? a. x = 4, y = 1, z = 5 b. x = -7, y = 1, z = 5 c. x = 3, y = 2, z = 6 d. x = 4, y = 2, z = 6

  2. What will be the result of the expression a % b when a and b are of type int and their values are a = 10 and b = 6? a. 4 b. 1.66 c. 1 d. None of these

  3. What will be the result of the expression a % b when a and b are of type int and their values are a = -17 and b = -6? a. -5 b. -23 c. None of these d. 5

View Answers

May 30, 2011 at 3:48 PM

1) -263 to 263 - 1, The type long is a 64-bit two's complement that can be used for long integers.

2) (A) & (B), Hexadecimal numbers start with "0x" in the Java programming language.


2) \u0000, The value of a variable of type char is 16 bits of data formatted as a Unicode character.

3) 13,When written in binary format, 15 is 1111, and 29 is 11101. 1111 & 11101 is 1101, which is 13 in decimal.

4) 27, When written in binary format, 27 is 11011, and 8 is 1000. 11011 | 1000 is 11011, which is 27.

5) (A), (B) & (C), The shift operation "y1 >>> y2" is identical to "y1 >> y2" for all positive values of y1. It shifts the bits in y1 to the right by y2 positions.

1) x = 3, y = 2, z = 6, Both y and z get incremented as a result of the last statement, but y gets incremented before and z after the assignment of the calculated value to x.

2) 4, The modulus operator (%) may be used with floating-point as well as integer types. It returns the remainder of a division operation. Therefore, 10 % 6 will return 4.

5) 5, The a % b calculates the remainder when a is divided by b.


Related Tutorials/Questions & Answers:
interview - Java Interview Questions
interview  kindly guide me some interview questions of Java
java - Java Interview Questions
Helpful Java Interview questions   Need Helpful Java Interview questions
interview questions - Java Interview Questions
interview questions for Java  Hi Any one can u please post the interview point of questions.Warm Regards, Satish
Java Interview Questions
Java Interview Questions  Hi, Can anyone tell the urls of Java Interview Questions on Thanks
Struts - Java Interview Questions
Struts Interview Questions  I need Java Struts Interview Questions and examples
java interview - JSP-Interview Questions
java interview  what type of questions would be asked to a 3 years experience person in java? can anyone please provide list of topics or interview questions for 3 years experience in java
help me - Java Interview Questions
interview questions java pdf   Do you have any PDF for Java Interview questions
jvm - Java Interview Questions
jvm  Can you provide some JVM Questions for Java Interview preparation
java questions - Java Interview Questions
java questions  HI ALL , how are all of u?? Plz send me the paths of java core questions and answers pdfs or interview questions pdfs or ebooks :) please favor me best books of interviews questions for craking
java - Java Interview Questions
Java Development  I need a Job in Java preparing for it. Can anyone please guide me how to prepare and what are the common questions that can be asked at interview
Interview Question - Java Interview Questions
Interview Question  I need Interview Questions on Java,J2EE Pls help me
Java - Java Interview Questions
Java  Questions on Java
Interview Questions - What is Java?
Interview Questions - What is Java?  What is Java?   Hi, Java is high level programming langue developed by James Gosling. Now Java.... Check in detail at: What is Java? View all Java Interview Questions
hint - Java Interview Questions
hint  Dear roseindia, i want the java interview question and the corresponding question answers.   Hi Friend, Please visit... of interview questions and their answers. Thanks  thanks for your
java - Java Interview Questions
/interviewquestions/ Here you will get lot of interview  hello sir this is suraj .i wanna ask u regarding interview questins in java .wat normally v see in interviews (tech apptitude)is one line
java - Servlet Interview Questions
java  servlet interview questions  Hi friend, For Servlet interview Questions visit to : Thanks
java - Servlet Interview Questions
Java Design Patterns Interview Questions and Answers  I need to know Java Design Patterns with the help of Interview Questions and Answers  Hi malli,GenericServlet is the super class of HttpServlet calssjava soft
java - Java Interview Questions
Java interview questions and answers for freshers  Please provide me the link of Java interview questions and answers for freshers  Hi friend,class Point{ int x, y; Point(){ System.out.println("default"
java - Java Interview Questions
java  i want to java&j2ee interview questions. Regards Akhilesh Kumar  Hi friend, I am sending you a link. This link will help you. Read for more information.
Interview Questions - Where Java is used?
Interview Questions - Where Java is used?  Hello, Where Java is used? Thanks   Hi, Java is used for creating various types... being Used?. View all interview questions at Java Interview Questions with Answers
Java - Java Interview Questions
Interview interview, Tech are c++, java,  Hi friend, Now get more information. you can lean all type interview question by following link
java - Java Interview Questions
while searching on google but if you want you can learn it in a interview preparation manner as well.. I have a java interview question URL from where you...:// if you wanna something more on java
Interview Questions - How Java is Used?
Interview Questions - How Java is Used?  Hi, How Java is Used... For Creating Applets Check: Where is Java being Used? View all interview questions at Java Interview Questions with Answers page. Thanks
Interview question - Java Interview Questions
Interview question   Hi Friends, I am new to java, can u tell me what is class ,object and instance with example. For example : class raja , raja r = new raja(); ,here raja is class and r is instance
Java - Java Interview Questions
:// Thank you for posting questions. Rose India Team
java - Java Interview Questions
java  MNC now which modal question are asked in interview
JAVA - Java Interview Questions
JAVA  i need objective Questions and answers ( with 4 or 5 choice) in JAVA. Can anyone help me?   H1!! pl. mail your email id to [email protected] I will send you within 2-3 days. Krishna
Interview question - Java Interview Questions
Interview question   Hi Friends, Give me details abt synchronization in interview point of view. I mean ow to explain short and neat. Thanks
Java interview questions and answers
Java interview questions and answers   what is garbage collection? What is the process that is responsible for doing that in java? Ans.Reclaiming... in Java? Ans. Runtime.getRuntime().exec(?.) 5.What is the basic difference
java interview question and answer - Java Interview Questions
java interview question and answer   sir, i want one mark java interview question and answers
java - JSP-Interview Questions
java  hi.. snd some JSP interview Q&A and i wnt the JNI(Java Native Interface) concepts matrial thanks krishna  Hi friend, Read more information.


Advertisement null