Tag: programming languages

Questions Related to programming languages

  1. A new type of Applet

  2. A segment of code to be run a specified amount of times

  3. A segment of code to be run infinite times

  4. A segment of code to be run once


Correct Option: B
  1. That there is a Boolean statement somewhere in your code

  2. That your Boolean statement will at some point be false

  3. That your Boolean statement will at some point be true

  4. All of the above


Correct Option: B
  1. Initialization

  2. Loop Body

  3. Test statement

  4. The word "while"


Correct Option: D
Explanation:

To solve this question, the user needs to know the basic structure of loops. Every loop has three main sections:

  1. Initialization
  2. Loop Body
  3. Test Statement

The initialization section is used to initialize the loop variable, while the test statement is used to evaluate a condition that determines whether the loop should continue or terminate. The loop body contains the code that is executed repeatedly until the test statement evaluates to false.

Option D is not a section of all types of loops. "While" is a keyword that is used to define a type of loop known as a "while loop". However, not all types of loops use the keyword "while". For example, the "for loop" uses a different syntax to define the loop.

Therefore, the correct answer is:

The Answer is: D

  1. A group of code lines that performs a specific task

  2. A group of code lines that performs a whole program

  3. Something that contains an ‘init’

  4. The purpose of Java


Correct Option: A
  1. Public functions are free, you have to buy private ones

  2. Public functions are the only ones you can download

  3. Public functions can be used by anyone, private can only be used by other code in the class you are writing

  4. Public functions can’t be used


Correct Option: C
Explanation:

To answer this question, the user needs to know the basic concepts of functions in programming.

Public and Private functions are both used in classes in Object-Oriented Programming.

Public functions are those that can be accessed by any other code outside of the class in which they are defined. That means that any other code that creates an object of this class can use the public function.

On the other hand, Private functions can only be accessed by the code within the same class. No other code outside of that class can access the private function.

Now, let's go through each option and explain why it is right or wrong:

A. Public functions are free, you have to buy private ones: This option is incorrect because the cost of the function does not depend on whether it is public or private. The access level of a function does not affect its cost.

B. Public functions are the only ones you can download: This option is incorrect because both public and private functions can be downloaded. The downloadability of a function is not related to its access level.

C. Public functions can be used by anyone, private can only be used by other code in the class you are writing: This option is correct. Public functions are accessible by any other code outside of the class in which they are defined, whereas private functions can only be accessed by the code within the same class.

D. Public functions can’t be used: This option is incorrect because public functions can be used by other code outside of the class in which they are defined.

Therefore, the correct answer is:

The Answer is: C. Public functions can be used by anyone, private can only be used by other code in the class you are writing.

  1. Advanced Window Toolkit

  2. Abstract window Toolkit

  3. Adjust Window Toolkit

  4. None of these


Correct Option: B