Latest Qualification Jobs


ENTER YOUR E-MAIL FOR FREE JOB ALERTS RIGHT INTO YOUR INBOX -
AFTER THIS, YOU WILL NOT MISS ANY GOVT/PVT VACANCY
Check Your Email To Activate the Confirmation Link

Core Java Quiz | Ques/Ans, Java Programming Online Test for Beginners

Core Java Quiz

Java is an object oriented programming language. Core Java Quiz helps applicant to clear the concepts and basics and will prepare for the Written Test & Interviews and many certification exams.

The Java Programming Online Test assesses applicants’ knowledge of programming in the Java language and their ability to influence commonly used parts of Java Class Library. Core Java Online Test contains 30 questions and there is no time limit to crack Core Java Test.

Core Java Quiz for Beginners!!!

It’s an ideal Core Java Quiz for pre-employment screening for Beginners. Applicants will get 1 point for each correct answer. You will get your Java Programming Quiz score after finishing the complete test.

Here on below page, we have provided the Core Java Quiz Questions and Answers. Scroll down this page of recruitmentresult.com to get complete details regarding Core Java Online Test Series. Have a look below for Core Java Quizzes!!!

Core Java Quiz

Core Java Online Quiz Questions & Answers:

Q1. What is a class in java?

  1. A class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.
  2. class is a special data type.
  3. class is used to allocate memory to a data type.
  4. none of the above.

Answer: 1

Must Check: Core Java Syllabus

Q2. What is the size of float variable?

  1. A – 8 bit
  2. B – 16 bit
  3. C – 32 bit
  4. D – 64 bit

Answer: 3

Q3. Which of the following is true about super class?

  1. Variables, methods and constructors which are declared private can be accessed only by the members of the super class.
  2. Variables, methods and constructors which are declared protected can be accessed by any subclass of the super class.
  3. Variables, methods and constructors which are declared public in the superclass can be accessed by any class.
  4. All of the above.

Answer: 4

Q4. What is static block?

  1. It is used to create syncronized code.
  2. There is no such block.
  3. It is used to initialize the static data member., It is excuted before main method at the time of class loading.
  4. None of the above.

Answer: 3

Give Now: Java Online Test

Q5. Which one is a valid declaration of a boolean?

  1. boolean b1 = 0;
  2. boolean b2 = ‘false’;
  3. boolean b3 = false;
  4. boolean b4 = Boolean.false();
  5. boolean b5 = no;

Answer: 3

Q6. What is the numerical range of a char?

  1. -128 to 127
  2. -(215) to (215) – 1
  3. 0 to 32767
  4. 0 to 65535

Answer: 4

Q7. You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

  1. public
  2. private
  3. protected
  4. transient

Answer: 3

Must Read: Java Programming Questions and Answers

Q8. What is the numerical range of char?

  1. 0 to 32767
  2. 0 to 65535
  3. -256 to 255
  4. -32768 to 32767

Answer: 2

Q9. Which collection class allows you to associate its elements with key values, and allows you to retrieve objects in FIFO (first-in, first-out) sequence?

  1. util.ArrayList
  2. util.LinkedHashMap
  3. util.HashMap
  4. util.TreeMap

Answer: 2

Q10. Which collection class allows you to access its elements by associating a key with an element’s value, and provides synchronization?

  1. util.SortedMap
  2. util.TreeMap
  3. util.TreeSet
  4. util.Hashtable

Answer: 4

Check Here: Tips To Score Good Marks

Q11. Which cannot directly cause a thread to stop executing?

  1. Calling the SetPriority() method on a Thread object.
  2. Calling the wait() method on an object.
  3. Calling notify() method on an object.
  4. Calling read() method on an InputStream object.

Answer: 3

Q12. Assume the following method is properly synchronized and called from a thread A on an object B: wait(2000); After calling this method, when will the thread A become a candidate to get another turn at the CPU?

  1. After thread A is notified, or after two seconds.
  2. After the lock on B is released, or after two seconds.
  3. Two seconds after thread A is notified.
  4. Two seconds after lock B is released.

Answer: 1

Q13. Which of the following will not directly cause a thread to stop?

  1. notify()
  2. wait()
  3. InputStream access
  4. sleep()

Answer: 1

Read Out: Tips To Create Your Own Study Guide

Q14. Which of the following would compile without error?

  1. int a = Math.abs(-5);
  2. int b = Math.abs(5.0);
  3. int c = Math.abs(5.5F);
  4. int d = Math.abs(5L);

Answer: 1

Q15. What is the value of “d” after this line of code has been executed? double d = Math.round ( 2.5 + Math.random() );

  1. 2
  2. 3
  3. 4
  4. 5

Answer: 2

Core Java Quiz Program Code

The following Core Java Programming Quiz will help you prepare for technical round of recruitment process. Then, you must go through this Core Java Quiz Questions and Core Java Online Quiz.

Q16.Is the following code compiles? If yes then what will be the output?

Answer: Compile: Yes and Output:String

Q17. Which two are acceptable types for x?

  • byte
  • long
  • char
  • float
  • Short
  • Long
switch(x)
{
default:
System.out.println(“Hello”);
}

1.1 and 3

2.2 and 4

3.3 and 5

4.4 and 6

Answer: 1

Q18.Which statement is true?

public void test(int x)
{
int odd = 1;
if(odd) /* Line 4 */
{
System.out.println(“odd”);
}
else
{
System.out.println(“even”);
}
}
  1. Compilation fails.
  2. “odd” will always be output.
  3. “even” will always be output.
  4. “odd” will be output for odd values of x, and “even” for even values.

Answer: 1

Q19.Which statement is true?

public class While
{
public void loop()
{
int x= 0;
while ( 1 ) /* Line 6 */
{
System.out.print(“x plus one is ” + (x + 1)); /* Line 8 */
}
}
}
  1. There is a syntax error on line 1.
  2. There are syntax errors on lines 1 and 6.
  3. There are syntax errors on lines 1, 6, and 8.
  4. There is a syntax error on line 6.

Answer: 4

Read Here: How To Find Online Study Material

Q20.Which one create an anonymous inner class from within class Bar?

class Boo
{
Boo(String s) { }
Boo() { }
}
class Bar extends Boo
{
Bar() { }
Bar(String s) {super(s);}
void zoo()
{
// insert code here
}
}
  1. Boo f = new Boo(24) { };
  2. Boo f = new Bar() { };
  3. Bar f = new Boo(String s) { };
  4. Boo f = new Boo.Bar(String s) { };

Answer: 2

Core Java Interview Questions Quiz

Check below mentioned Core Java Quiz Questions And Answers and start your preparation for interview sessions of Java Recruitment.

Q21. Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?

  1. java.lang.String
  2. java.lang.Double
  3. java.lang.StringBuffer
  4. java.lang.Character

Answer: 3

Get Here: Core Java Interview Questions and Answers

Q22. Which collection class allows you to grow or shrink its size and provides indexed access to its elements, but whose methods are not synchronized?

  1. java.util.HashSet
  2. java.util.LinkedHashSet
  3. java.util.List
  4. java.util.ArrayList

Answer: 4

Q23. What is the value of “d” after this line of code has been executed?double d = Math.round ( 2.5 + Math.random() );

  1. 2
  2. 3
  3. 4
  4. 2.5

Answer: 2

Q24.Which of the following would compile without error?

  1. int a = Math.abs(-5);
  2. int b = Math.abs(5.0);
  3. int c = Math.abs(5.5F);
  4. int d = Math.abs(5L);

Answer: 1

Q25.You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability?

1.java.util.Map

2.java.util.Set

3.java.util.List

4.java.util.Collection

Answer: 2

You May Read This: Strategies To Improve Memory

Q26. Which interface does java.util.Hashtable implement?

1.Java.util.Map

2.Java.util.List

3.Java.util.HashTable

4.Java.util.Collection

Answer: 1

Q27.Which interface provides the capability to store objects using a key-value pair?

1.Java.util.Map

2.Java.util.Set

3.Java.util.List

4.Java.util.Collection

Answer: 1

Q28. Which collection class allows you to access its elements by associating a key with an element’s value, and provides synchronization?

1.java.util.SortedMap

2.java.util.TreeMap

3.java.util.TreeSet

4.java.util.Hashtable

Answer: 4

Q29.Which is valid declaration of a float?

1.float f = 1F;

2.float f = 1.0;

3.float f = “1”;

4.float f = 1.0d;

Answer: 1

Q30. What is the numerical range of char?

1.0 to 32767

2.0 to 65535

3.-256 to 255

4.-32768 to 32767

Answer: 2

Download From Here: Core Java Quiz Questions And Answers PDF

What is the Scope of Java in Future?

Java is an object oriented programming language and has a simple object model, as it has derived from C and C++, which provides a virtual machine that, accumulated with byte-code and can run on any system. Now, as per today’s competitive business world, there is huge scope in Java Jobs.

The opportunities available for a Java Programmer are immense, and their technical knowledge is very valuable. So, there are numerous jobs opportunities available in Java, J2EE combining with other new technologies. These technologies are among the highest paid jobs in IT industry, as they come under software development.

Do You Know: How to Solve a Problem in Exam Correctly

Final words:

If applicants have any query regarding Core Java Quiz, then drop the comment in below provided comment box. You can also send their feedback about Core Java Quiz Program in comment box.

Follow us on Social media like FB, Google Plus and Twitter etc, in order to get updated details about Online Core Java Quiz, Latest Java Jobs etc on your timeline wall. Thank You…

Something That You Should Put An Eye On

Java Developer Salary In IndiaJava Interview Experience
Java Programming Interview QuestionsJava Interview Questions
Advanced Java SyllabusTips to Get Motivated for Everything
Tips to Make Study InterestingStep To Build Confidence & Destroy Fear

Filed in: online quiz, Question & Answers Tags: 

Leave a Reply

Submit Comment