Java NetBeans Programs for Class 11

Share with others

Java NetBeans Programs for Class 11: NetBeans is an open-source IDE (Integrated Development Environment) used to develop the Java application. NetBeans helps to create desktop applications, web-based applications and mobile applications.

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 –

  • 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.
  • Child controls – Child controls are controls that are positioned inside a container control. For instance, a text field, a label, a button, etc.

4. Write any two property of jFrame Form?

Answer – The two property of jFrame Form are –

  • defaultCloseOperation – Sets action to be performed when the user attempts to close the form.
  • 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.

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 –

  • getText() – Retrieves the text typed in jButton.
    • String result=<button-name>.getText( );
  • 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.

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.

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 –

  • Numeric Data Type – These data types are used to store integer values only i.e. whole numbers only.
    Example Byte, Short, Int, Long
  • 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.
  • 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.

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 –

  • 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.
  • Arithmetic Operator – These operators perform addition, subtraction, multiplication, and division. These symbols are similar to mathematical symbols. example +, -, *, /, %
  • 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.

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 jButton2 (“Calculate the perimeter” button)
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)
{
doublea,c;
a=Double.parseDouble(jTextField1.getText());
c=4*a;
jTextField3.setText(Double.toString(c));
}

//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

Disclaimer: We have taken an effort to provide you with the accurate handout of “Java NetBeans Programs for Class 11“. If you feel that there is any error or mistake, please contact me at anuraganand2017@gmail.com. The above CBSE study material present on our websites is for education purpose, not our copyrights. All the above content and Screenshot are taken from Information Technology Class 11 CBSE Textbook, Sample Paper, Old Sample Paper, Board Paper and Support Material which is present in CBSEACADEMIC website, This Textbook and Support Material are legally copyright by Central Board of Secondary Education. We are only providing a medium and helping the students to improve the performances in the examination. 

Images and content shown above are the property of individual organizations and are used here for reference purposes only.

For more information, refer to the official CBSE textbooks available at cbseacademic.nic.in

cbseskilleducation


Share with others

Leave a Comment