Java Programming - Level 2

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Rushikesh
R
Rushikesh
Community Contributor
Quizzes Created: 4 | Total Attempts: 4,191
| Attempts: 368 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1. Which of this keyword is used to make a class?

Explanation

The keyword "class" is used to make a class in programming. A class is a blueprint or template for creating objects, and it defines the properties and behaviors that an object of that class will have. In many programming languages, including Python, "class" is the keyword used to define a new class. Therefore, the correct answer is "class".

Submit
Please wait...
About This Quiz
Java Programming - Level 2 - Quiz

Grab your Java programming excellence certificate only on https://javasimplify. Blogspot. Com.
Terms and conditions to get your certificate:
1. You have to attend all questions to pass this exam
2. Need Minimum 60% aggregate to pass this quiz.
3. Must have 50% marks to get your verified certificate of java programming... see morelevel 2 test
4. You will get your certificate immediately from Java simplified once you finished the test with passing criteria. see less

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. Which keyword is used by​ the method to refer to the object that invoked it?​

Explanation

Explanation: this keyword can be used inside any method to refer to the current object. this is always a reference to the object on which the method was invoked.

Submit
3. Which of ​this method of String class is used to obtain character at specified index?

Explanation

The correct answer is charAt(). The charAt() method is used to obtain the character at a specified index in a String. It takes an index as a parameter and returns the character at that index.

Submit
4. Which of these is an incorrect array declaration?

Explanation

Explanation: Operator new must be succeeded by array type and array size.

Submit
5. Which of these operators can be used to concatenate two or more String objects?

Explanation

Explanation: operator + is used to concatenate strings, Example String s = “i ” + “like ” + “java”; String s contains “I like java”.

Submit
6. What is the range of byte data type in Java?

Explanation

Explanation: Byte occupies 8 bits in memory. Its range is from -128 to 127.

Submit
7. Which of these keywords is used to prevent content of a variable from being modified?

Explanation

Explanation: A variable can be declared final, doing so prevents its content from being modified. Final variables must be initialized when it is declared.

Submit
8. Which of ​this interface is implemented by Thread class?

Explanation

The correct answer is Runnable. The Thread class in Java implements the Runnable interface. This interface provides a way to define a task that can be executed concurrently by multiple threads. The Runnable interface has a single method called run(), which contains the code that will be executed when the thread is started. By implementing the Runnable interface, the Thread class can be used to create and control threads in Java.

Submit
9. What does AWT ​stand for?

Explanation

Explanation: AWT stands for Abstract Window Toolkit, it is used by applets to interact with the user.

Submit
10. Which of these is returned by "greater than", "less than" and "equal to" operators?

Explanation

Explanation: All relational operators return a boolean value ie. true and false.

Submit
11. What should be expression1 evaluate to in using​ the ternary operator as in this ​​ expression1 ? expression2 : expression3line?​ 

Explanation

Explanation: The controlling condition of ternary operator must evaluate to boolean.

Submit
12. Which of these can be overloaded?

Explanation

In object-oriented programming, overloading refers to the ability to define multiple methods or constructors with the same name but different parameters. This allows for flexibility and convenience when working with different data types or varying numbers of arguments. Therefore, both methods and constructors can be overloaded. By overloading methods or constructors, developers can create more versatile and reusable code.

Submit
13. Which of these is a mechanism for naming and visibility control of a class and its content?

Explanation

Explanation: Packages are both naming and visibility control mechanism. We can define a class inside a package which is not accessible by code outside the package.

Submit
14. Which operator is used to invert all the digits in​ the binary representation of a number?

Explanation

Explanation: Unary not operator, ~, inverts all of the bits of its operand in binary representation.

Submit
15. Literals in java must be appended ​to which of these?​

Explanation

Explanation: Data type long literals are appended by an upper or lowercase L.

Submit
16. Which of these is used to access ​member of class before the object of that class is created?

Explanation

The keyword "static" is used to access members of a class before an object of that class is created. Static members belong to the class itself rather than to any specific instance of the class. They can be accessed using the class name followed by the member name, without the need for an object to be created. This allows for the use of class variables and methods without the need to instantiate an object of the class.

Submit
17.  What is the prototype of the default constructor of this class?

Explanation

The correct answer is "public prototype( )". This is the prototype of the default constructor of the class. The "public" keyword indicates that the constructor is accessible from any other class. The "prototype" keyword is the name of the constructor, and the empty parentheses indicate that it does not take any parameters.

Submit
18. Which of these coding types ​are used for data type characters in Java?​

Explanation

Explanation: Unicode defines fully international character set that can represent all the characters found in all human languages. Its range is from 0 to 65536.

Submit
19. With x = 0, which of the following are legal lines of Java code for changing the value of x to1?
  1. x++;
  2. x = x + 1;
  3. x += 1;
  4. x =+ 1;

Explanation

Operator ++ increases value of variable by 1. x = x + 1 can also be written in shorthand form as x += 1. Also x =+ 1 will set the value of x to 1.

Submit
20. Which of these process occur automatically by java ​runtime system?

Explanation

Serialization and deserialization occur automatically by java runtime system, Garbage collection also occur automatically but is done by CPU or the operating system not by the java runtime system.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Sep 18, 2017
    Quiz Created by
    Rushikesh
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which of this keyword is used to make a class?
Which keyword is used by​ the method to refer to the object that...
Which of ​this method of String class is used to obtain character at...
Which of these is an incorrect array declaration?
Which of these operators can be used to concatenate two or more String...
What is the range of byte data type in Java?
Which of these keywords is used to prevent content of a variable from...
Which of ​this interface is implemented by Thread class?
What does AWT ​stand for?
Which of these is returned by "greater than", "less than" and "equal...
What should be expression1 evaluate to in using​ the ternary...
Which of these can be overloaded?
Which of these is a mechanism for naming and visibility control of a...
Which operator is used to invert all the digits in​ the binary...
Literals in java must be appended ​to which of these?​
Which of these is used to access ​member of class before the object...
 What is the prototype of the default constructor of this class?
Which of these coding types ​are used for data type characters in...
With x = 0, which of the following are legal lines of Java code for...
Which of these process occur automatically by java ​runtime system?
Alert!

Advertisement