Home » Java programming language

Java ClassLoader findSystemClass() method with example

ClassLoader Class findSystemClass() method: Here, we are going to learn about the findSystemClass() method of ClassLoader Class with its syntax and example.
Submitted by Preeti Jain, on November 27, 2019

ClassLoader Class findSystemClass() method

  • findSystemClass() method is available in java.lang package.
  • findSystemClass() method is used to find the class with the given binary name and load the class through the system loader if needed.
  • findSystemClass() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.
  • findSystemClass() method may throw an exception at the time of finding the class with the given class.
    ClassNotFoundException: This exception may throw when the given class does not exist.


    protected Class findSystemClass(String class_name);


  • String class_name – represents the binary name of the class.

Return value:

The return type of this method is Class, it returns a Class object for the given class name.


// Java program to demonstrate the example 
// of Class findSystemClass(String class_name)
// method of ClassLoader

class FindSystemClass extends ClassLoader {
    void loadedSystemClass() throws ClassNotFoundException {
        // It checks whether the given class is loaded
        // or not by using the findSystemClass()
        Class cl1 = super.findSystemClass("java.lang.String");

        // If cl1 not null that means cl1 is loaded
        // then don't need to load again
        if (cl1 != null)
            System.out.println("Class already loaded!!!");
            System.out.println("Ready to load the given class by using system classloader!!!");

public class Main {
    public static void main(String[] args) throws Exception {
        // Creating an instance of FindSystemClass
        FindSystemClass sc = new FindSystemClass();


Class already loaded!!!

Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.