Java and .NET Programming Concepts Quiz

Test your knowledge of Java and .NET programming language fundamentals including syntax, data types, keywords, OOP concepts, garbage collection, and framework components like ADO.NET, CLR, CTS, and CIL.

20 Questions Published

Questions

Question 1 True/False

GC is a high priority thread.

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

Which one is faster in java ? a. for(int i = 100000; i > 0; i--) {} b. for(int i = 1; i < 100001; i++) {}

  1. a
  2. b
  3. same
  4. can't say
Question 3 Multiple Choice (Single Answer)

Which one is not correct a. Float.isNan(x); b. x == Float.NaN; c. Myobject .equals(float.NaN);

  1. a
  2. b
  3. c
  4. Don't know
Question 4 Multiple Choice (Single Answer)

What will be output from the following statements: System.out.println(1+2+"3"); System.out.println("1"+2+3);

  1. 33, 33
  2. 123, 33
  3. 33, 123
  4. 123, 123
Question 5 True/False

Is the following statement correct: char ch = 'd'; if(ch < 32.00){ }

  1. True
  2. False
Question 6 True/False

.NET Framework provide platform for running .NET managed code in a virtual machine

  1. True
  2. False
Question 7 True/False

Code that targets the CLR is referred to as managed code

  1. True
  2. False
Question 8 True/False

CIL is high-level (machine) language, like Assembler, but is Object-oriented

  1. True
  2. False
Question 9 True/False

CTS is a set of specifications that all languages and libraries need to follow and will ensure interoperability between languages

  1. True
  2. False
Question 10 True/False

CLR is a rich type system built into the CTS which Implements various types (int, float, string, …)

  1. True
  2. False
Question 11 True/False

Base Class Library is set of basic classes: Collections, I/O, Networking, Security, etc.

  1. True
  2. False
Question 12 True/False

ADO.NET provides .NET applications with access to relational databases

  1. True
  2. False
Question 13 Multiple Choice (Single Answer)

Which statement is true about a method?

  1. A method is an implementation of an abstraction
  2. A method is an attribute defining the property of a particular abstraction
  3. A method is an operation defining the behavior for a particular abstraction
  4. A method is a blueprint for making operations
Question 14 Multiple Choice (Single Answer)

How do objects pass messages in Java?

  1. They pass messages by modifying each other's fields
  2. They pass messages by calling each other's instance methods
  3. They pass messages by modifying the static variables of each other's classes
  4. They pass messages by calling static methods of each other's classes
Question 15 Multiple Choice (Single Answer)

Which of the following is not a legal identifier?

  1. a2z
  2. 52pickup
  3. _class
  4. total#
Question 16 Multiple Choice (Single Answer)

Which statement is true?

  1. new and delete are keywords in the Java language
  2. try, catch, and thrown are keywords in the Java language
  3. return, goto, and default are keywords in the Java language
  4. for, while, and next are keywords in the Java language
Question 17 Multiple Choice (Single Answer)

Which of the following primitive data types are integer types?

  1. Type boolean
  2. Type float
  3. Type byte
  4. Type double
Question 18 Multiple Choice (Single Answer)

Which of the following lines are not valid declarations?

  1. char a = '\u0061';
  2. char 'a' = 'a';
  3. char \u0061 = 'a';
  4. ch\u0061r a = 'a';
Question 19 Multiple Choice (Multiple Answers)

Which of the following expressions evaluates to true?

  1. (false | true)
  2. (null != null)
  3. (4 <= 4)
  4. (true & false)
Question 20 True/False

1.Set s = new HashSet(); 2.s.add("JAVA"); 3.s.add(new Integer(5)); Line 3 will give ClassCast Exception because Two different types of object are getting added.

  1. True
  2. False