a) class b) object c) variable d) character array Answer: a
View Question
What will be the output of the following Java program?
class area
{
int width;
int length;
int height;
area()
{
width = 5;
length = 6;
height = 1;
}
void volume()
{
volume = width * height * length;
}
}
class cons_method
{
public static void main(String args[])
{
area obj = new area();
obj.volume();
System.out.println(obj.volume);
}
}
What will be the output of the following Java program? class area ...
View Question
What will be the output of the following Java program?
class Output
{
static void main(String args[])
{
int x , y = 1;
x = 10;
if(x != 10 && x / 0 == 0)
System.out.println(y);
else
System.out.println(++y);
}
}
What will be the output of the following Java program? class Output ...
View Question
What will be the output of the following Java program?
class box
{
int width;
int height;
int length;
int volume;
void volume()
{
volume = width * height * length;
}
void volume(int x)
{
volume = x;
}
}
class Output
{
public static void main(String args[])
{
box obj = new box();
obj.height = 1;
obj.length = 5;
obj.width = 5;
obj.volume(5);
System.out.println(obj.volume);
}
}
What will be the output of the following Java program? class box ...
View Question
What will be the output of the following Java program?
class equality
{
int x;
int y;
boolean isequal()
{
return(x == y);
}
}
class Output
{
public static void main(String args[])
{
equality obj = new equality();
obj.x = 5;
obj.y = 5;
System.out.println(obj.isequal);
}
}
What will be the output of the following Java program? class equality ...
View Question
What will be the output of the following Java program?
class box
{
int width;
int height;
int length;
int volume;
void volume(int height, int length, int width)
{
volume = width * height * length;
}
}
class Prameterized_method{
public static void main(String args[])
{
box obj = new box();
obj.height = 1;
obj.length = 5;
obj.width = 5;
obj.volume(3, 2, 1);
System.out.println(obj.volume);
}
}
What will be the output of the following Java program? class box ...
View QuestionWhich of these statement is incorrect?
a) Two or more methods with same name can be differentiated on the basis of ...
View QuestionWhich of these data type can be used for a method having a return statement in it?
a) void b) int c) float d) both int and float Answer: d
View QuestionWhich of these can be used to differentiate two or more methods having the same name?
a) Parameters data type b) Number of parameters c) Return type of method d) All of the mentioned Answer: ...
View QuestionWhat is the process of defining more than one method in a class differentiated by parameters?
a) Function overriding b) Function overloading c) Function doubling d) None of the mentioned Answer: b Explanation: Function ...
View Question