You are on page 1of 9

Skip to content

Menu

Java NetBeans Programs for Class 11


26/02/202316/07/2022 by CBSEskilleducation
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.

Contents show
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 –
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.
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
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;
a=Double.parseDouble(jTextField1.getText());
b=a*a; jTextField2.setText(Double.toString(b));
}

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


Unit 1 : Communication Skills Class 11 Notes
Unit 2 : Self­Management Skills Class 11 Notes
Unit 3 : Information and Communication Technology Skills Class
11 Notes
Unit 4 : Entrepreneurial Skills Class 11 Notes
Unit 5 : Green Skills Class 11 Notes
Employability Skills Class 11 MCQ
Unit 1 : Communication Skills Class 11 MCQ
Unit 1 : Communication Skills Class 11 MCQ
Unit 2 : Self­Management Skills Class 11 MCQ
Unit 3 : Information and Communication Technology Skills Class
11 MCQ
Unit 4 : Entrepreneurial Skills Class 11 MCQ
Unit 5 : Green Skills Class 11 MCQ
Employability Skills Class 11 Questions and
Answers
Unit 1 : Communication Skills Class 11 Questions and Answers
Unit 2 : Self­Management Skills – III
Unit 3 : Information and Communication Technology Skills Class
11 Questions and Answers
Unit 4 : Entrepreneurial Skills Class 11 Questions and Answers
Unit 5 : Green Skills Class 11 Questions and Answers
Information Technology Class 11 Notes
Unit ­1 : Computer Organization Class 11 Notes
Unit ­2 : Networking And Internet Class 11 Notes
Unit­3 : Office Automation Tools Class 11 Notes
Unit­4: RDBMS Class 11 Notes
Unit­5: Fundamentals of Java Class 11 Notes
Information Technology Class 11 MCQ
Unit ­1 : Computer Organization Class 11 MCQ
Unit ­2 : Networking And Internet Class 11 MCQ
Unit­3 : Office Automation Tools Class 11 MCQ
Unit­4: RDBMS Class 11 MCQ
Unit­5: Fundamentals of Java Class 11 MCQ
Information Technology Class 11 Questions and
Answers
Unit ­1 : Computer Organization Class 11 Questions and Answers
Unit ­2 : Networking And Internet Class 11 Questions and Answers
Unit­3 : Office Automation Tools Class 11 Questions and Answers
Unit­4: RDBMS Class 11 Questions and AnswersS
Unit­5: Fundamentals of Java Class 11 Questions and Answers
Categories CBSE Skill Education, Information Technology Class
11
Fundamentals of Java Class 11 MCQ
Database Concepts Class 12 Notes
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022

Algorithm
Flowchart
Artificial
Intelligence Class
10
Artificial
Intelligence Class
11
Artificial
Intelligence Class
12
Artificial
Intelligence Class 9
CBSE Academic
CBSE Academic
Electives
CBSE Class 9
Science
CBSE NCERT
Books PDF
CBSE Skill
Education
Class 9 Social
Class 9 Social
Science
Competitive Exams
Computer Science
Class 11
Computer Science
Class 12
Employability
Skills class 10
Employability
Skills Class 10
MCQ
Employability
Skills Class 10
MCQ Online Test
Employability
Skills Class 10
Notes
Employability
Skills Class 10
Question Answers
Employability
Skills Class 11
Employability
Skills Class 11
MCQ
Employability
Skills Class 11
Notes
Employability
Skills Class 11
Questions and
Answers
Employability
Skills Class 12
Employability
Skills Class 9
Employability
Skills Class 9 MCQ
Employability
Skills Class 9 Notes
Skills Class 9 Notes
Employability
Skills Class 9
Online Test
Employability
Skills Class 9
Questions and
Answers
Indian AI
Information
Technology Class
10
Information
Technology Class
11
Information
Technology Class
12
Information
Technology Class 9
JEE Exam
Music in India
National Cadet
Corps (NCC)
Physical Education
UPSC Short Notes
Web Application
Class 11
Web Application
Class 12

© 2023 CBSE Skill Education • Built with GeneratePress

You might also like