The 'Near Hire 2017 Pretest' focuses on Java programming fundamentals, assessing knowledge in compilation, code snippets, and object lifecycle.
Rate this question:
The program will fail to compile.
The program will throw a NullPointerException when run with zero arguments.
The program will print "no arguments" when called with zero argument and "1 arguments" when called with one argument.
The program will print "no arguments" and "2 arguments" when called with zero and one arguments.
The program will print "no arguments" and "3 arguments" when called with zero and one arguments.
Rate this question:
An import statement
A field declaration
A method declaration
A package declaration
Rate this question:
Obj.destroy();
Runtime.getRuntime().gc();
Obj = null;
Obj.finalize();
Obj.name = null; as well as obj = null;
Rate this question:
DB Configuration f; return f;
Return DBConfiguration;
Return new DBConfiguration();
Return 0;
Rate this question:
Int a = b = c = 100;
Int a, b, c; a = b = c = 100;
Int a, b, c=100;
Int a=100, b, c;
Int a= 100 = b = c;
Rate this question:
I = this.i1;
I = this.i2;
This = new Test( );
This.i = 4;
This.i1 = i2;
The class will fail to compile, since the class OtherClass is used before it is defined.
There is no problem with the code.
The class will fail to compile, since the class OtherClass must be defined in a file called OtherClass.java
The class will fail to compile.
None of the above.
Rate this question:
A static method can call other non-static methods in the same class by using the 'this' keyword.
A class may contain both static and non-static variables and both static and non-static methods.
Each object of a class has its own copy of each non-static member variable.
All methods in a class are implicitly passed a 'this' parameter when called.
Rate this question:
The program will fail to compile, since the static method main is trying to call the nonstatic method func.
The program will fail to compile, since the non-static method func cannot access the static member variable ref.
The program will fail to compile, since the argument args passed to the static method main cannot be passed on to the non-static method func.
The program will fail to compile, since method func is trying to assign to the nonstatic member variable 'arguments' through the static member variable ref.
The program will compile and run successfully.
Rate this question:
Import java.lang.*;
Package p.util;
Public class MyClass{ }
Abstract class MyClass{ }
Rate this question:
Replace the method body of m2() with a ; (semi-colon).
Replace the ; at the end of m1() with a method body.
Remove abstract from m2().
Remove abstract from the class declaration.
Rate this question:
Import static x.y.*
Import static x.y.SM;
Import static x.y.SM.foo;
Import static x.y.SM.foo();
Import static x.y.SM.*;
Rate this question:
Quiz Review Timeline (Updated): Mar 21, 2024 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Informatics Practice Quiz: Exam!
The Informatics Practice Quiz: Exam assesses knowledge in Java programming, focusing on swing controls, operators, loops, and switch-case statements. It is designed to test...
Questions:
10 |
Attempts:
454 |
Last updated:
Mar 19, 2023
|
Java Online Quiz 2
Java Online Quiz 2 assesses knowledge on Java programming basics including data types, variable declarations, and initialization. It is designed for learners to validate their...
Questions:
10 |
Attempts:
422 |
Last updated:
Mar 21, 2023
|
Java Programming Quiz
An interesting Java programming quiz is here for you if you use Java programming or are learning this language. The quiz is not going to be easy in any way. The questions designed...
Questions:
15 |
Attempts:
4778 |
Last updated:
Jul 03, 2023
|
Java Quiz-1
Java Quiz-1 assesses foundational Java programming skills through multiple-choice questions. Topics include constructor behaviors, method definitions, and class hierarchies. Ideal...
Questions:
100 |
Attempts:
5440 |
Last updated:
Sep 18, 2023
|
|
Java Quiz: Test Your GK! Trivia
This Java Quiz tests general knowledge in Java programming, covering topics like data types, access modifiers, OOP concepts, and applets. It assesses key skills for understanding...
Questions:
10 |
Attempts:
1007 |
Last updated:
Mar 22, 2023
|
Can You Answer These Java Programming Questions? Trivia Quiz
Can you answer these java programming questions? There are a lot of people who think that they can never fail any question they are asked when it comes to java programming, and to...
Questions:
10 |
Attempts:
541 |
Last updated:
Mar 22, 2023
|
Wait!
Here's an interesting quiz for you.