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

ADVERTISEMENT


Core Java Quiz | Core Java Programming Questions and Answers for Beginners

Core Java Quiz

Aspirants, if you’ve applied for Java Jobs’, then,you must have faced the core java technical round during the recruitment process. To qualify the employment session, take this online Core Java Quiz and improve your skills. In this article, we’re enlisting some tricky Core Java Programming Questions and Answers for Beginners. So, must take participating in Core Java Online Quiz and prepare well for applying Java Vacancies.   

As we all know that, Java is an object oriented programming language. So, by taking participation In Online Core Java Quiz, you will be tested on core java basics and OOPS concepts. Go through this page of recruitmentresult.com and get complete details about Core Java Online Quiz For Beginners, Core Java Programming Quiz Questions And Answers and other details etc.

Core Java Quiz

Beginners, you can try this Quiz Program In Core Javaand shareCore Java Quiz Online Test with others also if you like it.

Q1. Which one of these lists contains only Java programming language keywords?

  1. class, if, void, long, Int, continue
  2. goto, instanceof, native, finally, default, throws
  3. try, virtual, throw, final, volatile, transient
  4. strictfp, constant, super, implements, do

Answer: 2

Give Now: Java Online Test

Q2.Which will legally declare, construct, and initialize an array?

  1. int [] myList = {“1”, “2”, “3”};
  2. int [] myList = (5, 8, 2);
  3. intmyList [] [] = {4,9,7,0};
  4. intmyList [] = {4, 3, 7};

Answer: 4

Q3.Which is a reserved word in the Java programming language?

  1. method

2.native

  1. subclasses
  2. reference

Answer: 2

Q4. Which is a valid keyword in java?

  1. interface
  2. string
  3. Float
  4. unsigned

Answer: 1

Q5. 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

Get Here Details of: Core Java Syllabus

Q6. What is the prototype of the default constructor such as public class Test { }?

  1. Test( )
  2. Test(void)
  3. public Test( )
  4. public Test(void)

Answer: 3

Q7. What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?

  1. public
  2. abstract
  3. protected
  4. 4.default access

Answer: 4

Q8. What is the widest valid returnType for methodA in line 3?

public class ReturnIt

{

returnTypemethodA(byte x, double y) /* Line 3 */

    {

return (long)x / y * 2;

    }

}

  1. int
  2. byte
  3. long
  4. double

Answer: 4

Q9. Which of the following class level (nonlocal) variable declarations will not compile?

1.protectedint a;

2.transientint b = 3;

3.private synchronized int e;

4.volatileint d;

Answer: 3

Check Also: Java Programming Questions and Answers

Q10. Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?

1.final

2.static

3.private

4.protected

Answer: 3

Exception Handling In Core Java Quiz

Through below listed Core Java Quiz Questions And Answers, you can get complete idea about Exception Handling In Core Java. So, check this Core Java Quiz Questions With Answers…

Q11.What will be the output of the program?

public class Foo
{
public static void main(String[] args)
{
try
{
return;
}
finally
{
System.out.println( “Finally” );
}
}
}
  1. Finally
  2. Compilation fails.
  3. The code runs with no output.
  4. An exception is thrown at runtime.

Answer: 1

Q12.What will be the output of the program?

public class X
{
public static void main(String [] args)
{
try
{
badMethod();
System.out.print(“A”);
}
catch (Exception ex)
{
System.out.print(“B”);
}
finally
{
System.out.print(“C”);
}
System.out.print(“D”);
}
public static void badMethod()
{
throw new Error(); /* Line 22 */
}
}
  1. ABCD
  2. Compilation fails.
  3. C is printed before exiting with an error message.
  4. BC is printed before exiting with an error message.

Answer: 3

Want to Know? Tips To Create Your Own Study Guide

Q13. What will be the output of the program?

try
{
int x = 0;
int y = 5 / x;
}
catch (Exception e)
{
System.out.println(“Exception”);
}
catch (ArithmeticExceptionae)
{
System.out.println(” Arithmetic Exception”);
}
System.out.println(“finished”);
  1. finished
  2. Exception
  3. Compilation fails.
  4. Arithmetic Exception

Answer: 3

Q14. What will be the output of the program?

public class RTExcept
{
public static void throwit ()
{
System.out.print(“throwit “);
throw new RuntimeException();
}
public static void main(String [] args)
{
try
{
System.out.print(“hello “);
throwit();
}
catch (Exception re )
{
System.out.print(“caught “);
}
finally
{
System.out.print(“finally “);
}
System.out.println(“after “);
}
}

1.hellothrowit caught

2.Compilation fails

3.hellothrowitRuntimeException caught after

4.hellothrowit caught finally after

Answer: 4

Q15.What will be the output of the program?

public class X
{
public static void main(String [] args)
{
try
{
badMethod();
System.out.print(“A”);
}
catch (RuntimeException ex) /* Line 10 */
{
System.out.print(“B”);
}
catch (Exception ex1)
{
System.out.print(“C”);
}
finally
{
System.out.print(“D”);
}
System.out.print(“E”);
}
public static void badMethod()
{
throw new RuntimeException();
}
}
  1. BD
  2. BCD
  3. BDE
  4. BCDE

Answer: 3

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 future Scope Of Java Jobs?

In India, IT sector is the one, which has held the first position for long years with various pioneering trends. It has several stream and platforms to develop an application or product. While, we talk about programming languages and technologies, Java is the most popular platform, which is used to develop numerous applications for the systems as well as embedded devices and many more.

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 machinethat 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. Aspirants, who’ve enough knowledge in this language, they must avail the current openings in Java.

Final words:

Contenders, if the problem lies in the practicing part, then it can be overcome by taking participation in Core Java Quiz. 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 Quiz Application In Core Java Source Code, 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: 

20, 00,000+ Top Jobs For Freshers, Salary 1.75 Lakh– Apply Now

ADVERTISEMENT


Leave a Reply

Submit Comment