Home Computer Science Classes and Objects in Java MCQ Quiz

Classes and Objects in Java MCQ Quiz

This Java Quiz is based on Classes and Objects in Java MCQs. You can read Classes and Objects in Java Tutorial. You can also attempt the previous Loops in Java MCQ Quiz or Next Selection statements in Java MCQ Quiz

801

A class in java defines a new data type. Once defined, this new type can be used to create objects of that type. Thus, a class is a template for an object, and an object is an instance of a class. Because an object is an instance of a class, you will often see the two words object and instance used interchangeably.

When you define a class, you declare its exact form and nature. You do this by specifying the data that it contains and the code that operates on that data. While very simple classes may contain only code or only data, most real-world classes contain both. A class’s code defines the interface to its data. A class is declared by the use of the class keyword. Classes can (and usually do) get much more complex. A simplified general form of a class definition is shown here:

class classname {
type instance-variable1;
type instance-variable2;
// ...
type instance-variableN;

type methodname1(parameter-list{
// body of method
}

type methodname2(parameter-list{
// body of method
}
// ...
type methodnameN(parameter-list{
// body of method
}
}

Quiz Description: 

Name: Classes and Objects in Java MCQ Quiz

Subject:  Java

Topic: Classes and Objects

Questions: 15 Objective Type Questions

Time Allowed: 15 Minutes

Language: English

Important for:  B. Tech. / M. Tech. Students, B.Sc. / M.Sc. (CS / IT) and aspirants of I.E.S. and other competitive exams, computer science job interviews, Java job interviews, etc.

Created By: Esha Tripathi

Previous QuizLoops in Java – MCQ Quiz
Next QuizSelection Statements in Java MCQ Quiz

LEAVE A REPLY

Please enter your comment!
Please enter your name here