CBSE Class 12 Informatics Practices More About Classes And Libraries Assignment

Read and download the CBSE Class 12 Informatics Practices More About Classes And Libraries Assignment for the 2025-26 academic session. We have provided comprehensive Class 12 Informatics Practices school assignments that have important solved questions and answers for More About Classes And Libraries. These resources have been carefuly prepared by expert teachers as per the latest NCERT, CBSE, and KVS syllabus guidelines.

Solved Assignment for Class 12 Informatics Practices More About Classes And Libraries

Practicing these Class 12 Informatics Practices problems daily is must to improve your conceptual understanding and score better marks in school examinations. These printable assignments are a perfect assessment tool for More About Classes And Libraries, covering both basic and advanced level questions to help you get more marks in exams.

More About Classes And Libraries Class 12 Solved Questions and Answers

Brief Summary of the Chapter:
In this chapter the way access of members of a class i.e. about access specifier will be discuss. Java include predefined classes in the form of packages which are also called Java class Library. Some of the used packages are: java.lang. java.util, java.io, java.swing. java.awt, java.applet etc.
Key points:
• The public member of object are accessed through .(dot) operator.
• The private members are accessible only inside their own class.
• The protected members are accessible inside their own class, sub class and packages.
• The default members are accessible inside their own class as well to classes in the same package.
• Related classes and interfaces are grouped together in the form of package.
• Packages and class are imported through import command.

SOLVED QUESTIONS

1. Which keyword can protect a class in a package from accessibility by the classes outside the package?
(a) private
(b) protected
(c) final
(d) None of these
Ans: (d) None of these.

2. We would like to make a member of a class visible in all subclasses regardless of what package they are in. Which one of the following keywords would achieve this?
(a) private
(b) protected
(c) final
(d) public
(e) None of these
Ans: (b) protected.

3. Which of the following keywords are used to control access to a class member?
(a) default
(b) abstract
(c) protected
(d) interface
(e) public.
Ans: (c) and (e) public

4. The public members of objects are accessed through which operator.
(a) arrow
(b) dot
(c) this
(d) none of these
Ans: (b) dot

5. The private members are accessible only inside their _______class.
(a) own
(b) sub
(c) super
(d) none of these
Ans: (a) own

6. Which command is used to import packages and their classes?
(a) include
(b) import
(c) public
(d) inline
Ans: (b) import

7.Which statement is used to create a package in Java?
(a) Class
(b) super
(c) this
(d) package
Ans:(d) package

8. In Java, all strings are objects?
(a) True
(b) False
(c) don’t say
Ans: (a) True

9. What do you understand by Package in Java?
Ans: A group of classes is called package

10.Given a package named EDU. Student, how would you import a class named Test contained in this package? Write one line statement.
Ans: import EDU.Student.Test;

11. What will be the output of the following code
StringBuffer city = new StringBuffer(“Madras”) ;
StringBuffer string = new StringBuffer() ;
string.append(new String(city) ) ;
string.insert(0,”Central”) ;
string.out.println(string) ;
Ans: CentralMadras.

12. Give the output of the following program:
class MainString
{ public static void main( String agrs[])
{ StringBuffer s = new StringBuffer(“String”) ;
if(s.length() > 5) && (s.append(“Buffer”) .equals(“x”) ;
System.out.println(s) ;
}
}
Ans: StringBuffer.

13. What is the output of the following code fragment if “abc” is passed as argument to the func() ?
Public static void func(string s1)
{
String s = s1 + “xyz”;
System.out.println(“s1=” + s1) ;
System.out.println(“s = “ +s) ;
}
Ans: s1= abc
s =abcxyz

14.What are the access specifiers in Java? Expalin.
Ans: The Access Specifiers control access to members of class from / within Java Program. Java supports various Access Specifiers to control the accessibility of class members.
• Private : A variable or method declared as private, may not be accessed outside of the class. Only class member can access them, since they are private to others.
• Protected: Protected members can be accessed by the class members and subclasses (derived classes) and current package, but they are not accessible from beyond package or outside.
• Public: Class members declared as public, are accessible to any other class i.e. everywhere , since they are public.
• Package (default) : If no any specifier is mentioned, default or friendly access is assumed. Class member may be accessed by any other Class members available in the same package, but not accessible by the other classes outside the package, even subclasses.

15. What do you meant by private, public, protected, package(friendly) access specifiers?
Ans: Private Access Specifier
Members declared as private are accessible by the members of the same class, since they are private.
A private key word is used to specify.
//e.g to demonstrate private specifier.//
class abc
{ private int p;
private void method1()
{ p=10;
system.out.print(“I am Private method”) ;
}
}
class xyz
{……….
void method2()
{ abc x = new abc() ;
x.p =10;
x.method1() ;
}
}
Protected Access Specifier
Protected members are accessible by all the classes in the same package and sub-classes (same of different packages) . A protected key word is used to specify.
Package mypackage;
class abc
{ protected int p;
protected void method1()
{ p=10;
system.out.print(“Protected
method”) ;
}
}
class xyz
{……….
void method2()
{ abc x = new abc() ;
x.p =10;
x.method1() ;
}
}
Lets another Package…
package yourpackage;
import mypackage.*;
class pqr extends abc
{ void method3()
{ abc x=new abc() ;
pqr y=new pqr() ;
x.p=10;
x.method1() ;
y.p=10;
y.method1() ;
}
}
Public Access Specifier
Public Members can be access at anywhere i.e. same or different package. A public key word is used to specify.
packagemypackage;
class abc
{ public int p;
public void method1()
{ p=10;
system.out.print(“Public method”) ;
}
}
package yourpackage;
import mypackage.* ;
class xyz
{……….
void method2()
{ abc x = new abc() ;
x.p =10;
x.method1() ;
}
}
Package (friendly) Access Specifier
If no specifier is explicitly specified, Java assumes default (friendly) access i.e. all the members are accessible in all other classes of the same package only, since they are trusted or friends. This is called Package level access. No any key word is used to specify default access.
package mypackage;
class abc
{ int p;
void method1()
{ p=10;
system.out.print(“Package method”) ;
}
}
class xyz
{……….
void method2()
{ abc x = new abc() ;
x.p =10;
x.method1() ;
}
}

16. What do you understand by Library in Java?
Ans: A library is readymade and reusable component/codes that can be used in a program to perform predefined task.
• Some commonly used Java libraries are Math Library, String Library, Utility Library and IO Library etc.
• You can use import statement at the top of the program to include the Java libraries.
import java.io.*;
• The java.lang is the default imported library in your program without writing import statement.
String Library & its commonly used methods
1 .boolen equals(str) - Compare this (current) string to given string and returns true if both are true otherwise false. e.g. boolean test=str1.equals(str2) ;
2. int compareTo(str1,str2) - Compare two strings in alphabetical order. boolean equalsIgnoreCase(str) - Compare this string to given string but ignores case difference.
3. int length() -Returns the length of this string.
e.g. int x=str1.length() ;
Math Library & its commonly used methods
• Java provides math library, which available under java.lang package.
• In order to use functions/methods of math library, you need to invoke function using math keywords before the function.
e.g. x=math.abs(-7.5) ;
1. pow(num1,num2) - It computes num1 num2 , where num1 and num2 are numbers.
e.g. syste.out.print(“”+math.pow(2,3) ;
2. round(num1) - It rounds off a given number to its nearest integer. It can take float/double as argument. e.g.
system.out.print(“”+math.round(1.5) ) ; 2
system.out.print(“”+math.round(-1.5) ) ; -1
Using Dates & Times in JAVA
• Java offers two classes in java.util package to manipulate date and time.
1. java.util.Date 2. java.util.Calendar
• In order to use Date & calendar, you need to import java.util package. E.g. import java.util.*;
Date d=new Date() ; -It returns system date in the given format.
Tue Jul 20 17:30:22 GMT+05:30 2010

UNSOLVED QUESTIONS

1. What are the different types of access specifier supported by java?

2. Which is the default package of java?

3. What is friendly access of class member?

4. How does a class enforce information hiding?

5. Define an abstract class and abstract methods.

6. What is an interface? What is the use of Interface.

CBSE Class 12 Informatics Practices More About Classes And Libraries Assignment

Access the latest More About Classes And Libraries assignments designed as per the current CBSE syllabus for Class 12. We have included all question types, including MCQs, short answer questions, and long-form problems relating to More About Classes And Libraries. You can easily download these assignments in PDF format for free. Our expert teachers have carefully looked at previous year exam patterns and have made sure that these questions help you prepare properly for your upcoming school tests.

Benefits of solving Assignments for More About Classes And Libraries

Practicing these Class 12 Informatics Practices assignments has many advantages for you:

  • Better Exam Scores: Regular practice will help you to understand More About Classes And Libraries properly and  you will be able to answer exam questions correctly.
  • Latest Exam Pattern: All questions are aligned as per the latest CBSE sample papers and marking schemes.
  • Huge Variety of Questions: These More About Classes And Libraries sets include Case Studies, objective questions, and various descriptive problems with answers.
  • Time Management: Solving these More About Classes And Libraries test papers daily will improve your speed and accuracy.

How to solve Informatics Practices More About Classes And Libraries Assignments effectively?

  1. Read the Chapter First: Start with the NCERT book for Class 12 Informatics Practices before attempting the assignment.
  2. Self-Assessment: Try solving the More About Classes And Libraries questions by yourself and then check the solutions provided by us.
  3. Use Supporting Material: Refer to our Revision Notes and Class 12 worksheets if you get stuck on any topic.
  4. Track Mistakes: Maintain a notebook for tricky concepts and revise them using our online MCQ tests.

Best Practices for Class 12 Informatics Practices Preparation

For the best results, solve one assignment for More About Classes And Libraries on daily basis. Using a timer while practicing will further improve your problem-solving skills and prepare you for the actual CBSE exam.

Where can I download in PDF assignments for CBSE Class 12 Informatics Practices More About Classes And Libraries

You can download free Pdf assignments for CBSE Class 12 Informatics Practices More About Classes And Libraries from StudiesToday.com

How many topics are covered in More About Classes And Libraries Informatics Practices assignments for Class 12

All topics given in More About Classes And Libraries Informatics Practices Class 12 Book for the current academic year have been covered in the given assignment

Is there any charge for this assignment for More About Classes And Libraries Informatics Practices Class 12

No, all Printable Assignments for More About Classes And Libraries Class 12 Informatics Practices have been given for free and can be downloaded in Pdf format

Are these assignments for More About Classes And Libraries Class 12 Informatics Practices designed as per CBSE curriculum?

Latest syllabus issued for current academic year by CBSE has been used to design assignments for More About Classes And Libraries Class 12

Are there solutions or answer keys for the Class 12 Informatics Practices More About Classes And Libraries assignments

Yes, we have provided detailed answers for all questions given in assignments for More About Classes And Libraries Class 12 Informatics Practices