Please select a subject first
Advertisements
Advertisements
Identify the statement given below as assignment, increment, method invocation or object creation statement.
System.out.println(“Java”);
Concept: Different Types of Methods
What value will Math.sqrt (Math.ceil (15.3)) return?
Concept: Introduction of Mathematical Library Methods
Design a class with the following specifications:
| Class name: | Student |
| Member variables: | name - name of student age - age of student mks - marks obtained stream - stream allocated (Declare,the, variables using appropriate data types) |
Member methods:
| void accept() - | Accept name, age and marks using methods of Scanner class. |
| void allocation() - | Allocate the stream as per following criteria: |
| " mks | stream |
| >=300 | Science and Computer |
| >=200 and <300 | Commerce and Computer |
| >=75 and 200 | Arts and Animation |
| <75 | Try Again |
void print() Display student name, age, mks and stream allocated.
Call all the above methods in main method using an object.
Concept: Different Types of Methods
What is the output of Math.ceil(5.4) + Math.ceil(4.5)?
Concept: Introduction of Mathematical Library Methods
Which of the following mathematical methods returns only an integer?
Concept: Introduction of Mathematical Library Methods
Write Java expression for:
`(|a + b|)/(sqrt(a^2 + b^2))`
Concept: Methods of Math Class
Write the java expression for `root3x + sqrty`
Concept: Introduction of Mathematical Library Methods
Differentiate between constructor and function.
Concept: Invoking a Constructor
What is a parameterized constructor?
Concept: Features of a Constructor
Name the two types of constructors.
Concept: Features of a Constructor
Write two characteristics of a constructor.
Concept: Need of using a Constructor
Write the output of the following program code:
char ch ;
int x=97;
do
{
ch=(char) x;
System.out.print(ch + “ ” );
if(x%10 == 0)
break;
++x;
}while(x<=100);
Concept: Features of a Constructor
when is a constructor invoked?
Concept: Concept of Constructor
The absence of which statement leads to fall through situation in switch case statement?
Concept: Introduction of Conditional Statements in Java
Consider the following program segment and select the output of the same when n = 10:
switch(n)
{Case 10: System.out.println(0*2);
case 4: System.out.println(n*4); break;
default : Syslem.out.println(n);
}Concept: Introduction of Conditional Statements in Java
Rewrite the following code using the if-else statement:
int m = 400;
double cl). = (m>300) ? (m/10.0) * 2; (m/20.0) - 2;Concept: Introduction of Conditional Statements in Java
Give the output of the following program segment:
int n = 4279; int d;
while(n>0)
(d=n%10;
System.out.println(d);
n=n/100;
}Concept: Introduction of Conditional Statements in Java
Name the following:
The method which has same name as that of the class name.
Concept: Concept of Constructor
Which of the following data type cannot be used with switch case construct?
Concept: Introduction of Conditional Statements in Java
If the name of the class is "Yellow", what can be the possible name for its constructors?
Concept: Types of Constructor
