Question: 1.What is the output of the following java code? String A = SCIENCE; System.out.println (A.substring (3, 5)); a.SCIE b.EN c.ENCE d.SC 2.Analysis the following class

1.What is the output of the following java code?

String A = SCIENCE; System.out.println (A.substring (3, 5));

a.SCIE

b.EN

c.ENCE

d.SC

2.Analysis the following class definition and answer the following question.

class Test{

double mark;

void setMark (double m){

mark = m; }

private double calTotal(){

return mark * 0.5; }

void display(){

System.out.println(mark);

}}

.

What is data type of member variable?

a.No data type

b.public

c.double

d.void

3.Any entity that has properties and behavior is known as ______________

a.Program

b.Source

c.JVM

d.Object

4.Which is the correct format to declare one dimensional array to store 4 integer numbers in Java?

a.int n = new[4];

b.int n;

c.int[] n = new int[4];

d.int[4] n;

5_______ class can be used for user input in Java.

a.Scanner

b.io

c.Utility

d.method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!