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.
Questions
GC is a high priority thread.
- True
- False
Which one is faster in java ? a. for(int i = 100000; i > 0; i--) {} b. for(int i = 1; i < 100001; i++) {}
- a
- b
- same
- can't say
Which one is not correct a. Float.isNan(x); b. x == Float.NaN; c. Myobject .equals(float.NaN);
- a
- b
- c
- Don't know
What will be output from the following statements: System.out.println(1+2+"3"); System.out.println("1"+2+3);
- 33, 33
- 123, 33
- 33, 123
- 123, 123
Is the following statement correct: char ch = 'd'; if(ch < 32.00){ }
- True
- False
.NET Framework provide platform for running .NET managed code in a virtual machine
- True
- False
Code that targets the CLR is referred to as managed code
- True
- False
CIL is high-level (machine) language, like Assembler, but is Object-oriented
- True
- False
CTS is a set of specifications that all languages and libraries need to follow and will ensure interoperability between languages
- True
- False
CLR is a rich type system built into the CTS which Implements various types (int, float, string, …)
- True
- False
Base Class Library is set of basic classes: Collections, I/O, Networking, Security, etc.
- True
- False
ADO.NET provides .NET applications with access to relational databases
- True
- False
Which statement is true about a method?
- A method is an implementation of an abstraction
- A method is an attribute defining the property of a particular abstraction
- A method is an operation defining the behavior for a particular abstraction
- A method is a blueprint for making operations
How do objects pass messages in Java?
- They pass messages by modifying each other's fields
- They pass messages by calling each other's instance methods
- They pass messages by modifying the static variables of each other's classes
- They pass messages by calling static methods of each other's classes
Which of the following is not a legal identifier?
- a2z
- 52pickup
- _class
- total#
Which statement is true?
- new and delete are keywords in the Java language
- try, catch, and thrown are keywords in the Java language
- return, goto, and default are keywords in the Java language
- for, while, and next are keywords in the Java language
Which of the following primitive data types are integer types?
- Type boolean
- Type float
- Type byte
- Type double
Which of the following lines are not valid declarations?
- char a = '\u0061';
- char 'a' = 'a';
- char \u0061 = 'a';
- ch\u0061r a = 'a';
Which of the following expressions evaluates to true?
- (false | true)
- (null != null)
- (4 <= 4)
- (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.
- True
- False