Name any two library packages of java .
Two library packages of Java are lang and io package. lang package is the largest package among the all java library packages. Classes like System, String etc are inbuilt classes of lang package. BufferedReader is one of the classes in io package.State two main features of Object Oriented Programming languages
Two main feature of Object Oriented Programming languages are Encapsulation and Inheritance.
What is meant by a user defined data type?
In java library packages numbers of classes are defined. They are all pre defined classes. Apart from those predefined classes we can define our own class using the keyword class. Within the class body we normally declare data members and define function members. These classes are called user defined data type.Give an example of syntax error
Syntax error means the error which occurs during compilation time.Example is System. out. println (“Error…Colon is placed instead of semi colon.”):
What is the scope of the keyword protected in accessing functions?
Excepting sub classes, no other classes can access protected functions of any class.
What is a parameterized constructor?
Parameterized constructor means the constructor which takes value(s) as argument when invoked to create object. Such constructors normally initialize the data members of the objects while the object is created.What is the use of static in the main function?
Static keyword in function means the function is a class member, not an instance member. A class function or static function means whose existence does not depend on the creation of the object and such member can be used before creating the object. As to run a program, we have to execute the main function first, main function is a static function.
No comments:
Post a Comment