Java NetBeans Programs for Class 11

Teachers and Examiners (CBSESkillEduction) collaborated to create the Java NetBeans Programs for Class 11 QA. All the important Information are taken from the NCERT Textbook Information Technology (802) class 11.

Java NetBeans Programs for Class 11

1. What is the purpose of NetBeans IDE?
Answer – Java applications can be simply created utilizing the effective GUI builder in the NetBeans IDE. We can create application by dragging and dropping GUI elements from a palette onto a container. Correct spacing and alignment of the various components in relation to one another are handled automatically by the GUI builder.

3. What is the difference between Parent control and Child control in NetBeans?
Answer – There are two different type of control –
a. Parent or container controls – Controls that serve as a parent or container serve as the backdrop for other controls. Consider Frame. All of a parent control’s child controls are also destroyed when we remove it. All of a parent control’s child controls move with it when the parent control is moved.

b. Child controls – Child controls are controls that are positioned inside a container control. For instance, a text field, a label, a button, etc.

Java NetBeans Programs for Class 11

4. Write any two property of jFrame Form?
Answer – The two property of jFrame Form are –
a. defaultCloseOperation – Sets action to be performed when the user attempts to close the form.
b. Title – Sets the text to be displayed in the Title bar of the form window.

5. What id purpose of property in NetBeans?
Answer – An object’s properties are used to determine how it will display on the form. For instance, you can alter a textfield’s background color, font, and other properties by changing its background attribute.

6. What is Methods?
Answer – To do some action on the object, methods are employed. For instance, you may use a textfield’s setText() method to show something in it or use its getText() method to retrieve its contents. Getters and setters are the two categories into which methods can be separated.

Java NetBeans Programs for Class 11

7. What is Event?
Answer – Events are the actions which are performed on controls. Examples of events are mouseClick, mouseMoved,keyPressed etc. When the user performs any action on a control, an event happens and that event invokes the corresponding part of the code and the application behaves accordingly.

8. Write any two method of jButton?
Answer –
a. getText() – Retrieves the text typed in jButton.
String result=<button-name>.getText( );
b. setText() – Changes the display text at runtime.
<button-name>.setText(String text);

9. What is Object Oriented Programming Language?
Answer – Object-oriented programming is known as OOP. While object-oriented programming involves constructing objects that include both data and functions, procedural programming involves developing procedures or functions that perform actions on the data.

Java NetBeans Programs for Class 11

10. What are the major components of Object Oriented Programming?
Answer – The major components of Object Oriented Programming are –
1. Class
2. Object
3. Data Members & Methods
4. Access Specifier and Visibility Modes

11. What is data member and method?
Answer – Methods and data members are accessible in classes. In actual Java programming, the methods are a series of steps put together to carry out a certain action on the data, whilst the data will need to adhere to a specified data type, such as char, int, float, or double.

12. What is Variables?
Answer – Variables act as a kind of container for the data they hold. Because they can change their value but not their name, these things are called variables.

Java NetBeans Programs for Class 11

13. What are the different characteristics of variable?
Answer – The characteristics of a variable are:
• It has a name.
• It is capable of storing values.
• It provides temporary storage.
• It is capable of changing its value during program execution.

14. What is Data types? What are the different type of Data Type.
Answer – The data type describes the actions that may be performed on the type, the range for the type, and how the type’s values are stored. Some of the example of data types are –

a. Numeric Data Type – These data types are used to store integer values only i.e. whole numbers only.
Example Byte, Short, Int, Long

b. Floating Data Types – These data types are used to store numbers having decimal points i.e. they can store numbers having fractional values. for example float & double.

c. Character Data Types – These data types are used to store characters. Character data types can store any type of values – numbers, characters and special characters.

Java NetBeans Programs for Class 11

15. What is Operator? What are the different type of operators.
Answer – Operators are symbols that manipulate, combine or compare variables. The operators available in java are –
a. Assignment Operator – One of the most common operators is the assignment operator “=” which is used to assign a value to a variable. We assign the value given on the right hand side to the variable specified on
the left hand side.

b. Arithmetic Operator – These operators perform addition, subtraction, multiplication, and division. These symbols are similar to mathematical symbols. example +, -, *, /, %

c. Relational Operator – A relational operator is used to test for some kind of relation between two entities. A mathematical expression created using a relational operator forms a relational expression or a condition. example ==, !=, >, <, >=, <=

16. What is Bitwise Operator?
Answer – Bitwise operators can be used to change a number’s individual bits. They are compatible with all integral kinds (char, short, int, etc). They are utilised while updating and searching a binary indexed tree.

Java NetBeans Programs for Class 11

17. Design a GUI application to accept the side of a square in a text field and calculate the area and perimeter of the square. Add Refresh button to clear all text fields and a Stop button to end the application.
Hint [ Area of a square = side * side and perimeter = 2(side +side)]
Answer – //Coding for jButton1 (“Calculate the area” button)
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
double a,b;
b=a*a; jTextField2.setText(Double.toString(b));

//Coding for jButton2 (“Calculate the perimeter” button)
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)

//Coding for jButton4 (“Refresh” button)
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt)
jTextField1.setText(” “);jTextField2.setText(” “);jTextField3.setText(” “);

Employability Skills Class 11 Notes

Employability Skills Class 11 MCQ

Employability Skills Class 11 Questions and Answers

Information Technology Class 11 Notes

Information Technology Class 11 MCQ

Information Technology Class 11 Questions and Answers

error: Content is protected !!