Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi chegg expert please I need your help it's urgent and very important for me please.I don't have enough time. It's a multiple choice questions

Hi chegg expert please I need your help it's urgent and very important for me please.I don't have enough time. It's a multiple choice questions in Java I need the correct answer of each question please please

1 In the following keywords, which one can be used to create an instance of one class ( ) AClass BNew CPrivate Dvoid

2 Which of the following identifiers is incorrect Atestjava_1 B$numberjava C1_numberjava DstartTimeJava

3 What is the output of the following program fragment? int a = 2; int b = 2; if (a==b) System.out.println(a=+a); Aa = 2 Ba = 0 CCompile error and cannot run DNormal operation but no output

4 Assume that a method will generate a non-RuntimeException. If you want to hand the exception to the method that called the method, what is the correct way to declare Athrow Exception B.throws Exception Cnew Exception Dno need to declare 5 Which definition is wrong? Afloat x(int a, int b){return a-b;} Bint x(int a, int b){return a-b;} Cint x(int a, int b);{return a*b;} Dint x(int a, int b){return 1.2 * (a+b);}

6 After executing String [] s = new String [9]; which of the following conclusions are correct ( ) As[8] is Bs[8] is null Cs[0] is undefined DNone of them

7 Which of the following statements about interfaces in Java is true? ( ) AThe interface contains the implementation method of the specific method BIf a class implements an interface, the "implements" keyword is used CIf a class implements an interface, the "extends" keyword is used DInterface does not allow inheritance

8 Indicate which of the following methods are unreasonable overload methods of public void overload(int x, int y){}. Apublic long overload (long x, long y){} Bpublic float overload (float x, float y){} Cpublic void overload (int x){} Dpublic int overload (int a, int b){}

9 The value of the Expression(x>y) ? (z>w) ? x : z : wwhere x=5,y=9,z=1,w=9is( ) A5 B8 C1 D9

10 A class has a method with no formal parameters and no return value. Other classes can call it with the class name A as the prefix. The method header is written as ( ) Astatic void method() Bpublic void method() Cfinal void method() Dabstract void method()

11 Which of the following options defines a valid abstract class Aabstract Shape {abstract void area();} Bclass abstract Shape {abstract void area();} Cabstract class Shape {abstract void area();} Dabstract class Shape {abstract void area() { }}

12 The result of Harbison.substring(3) is AHar Bson Crbison Dbison

13 When a new class is defined , which keyword is impossible to used( ) Aprotected Bclass Cextended Dpublic

14 Integer data type that require the least memory space are Ashort Blong Cint Dbyte

15 Which of the following import commands allows us to create input / output stream objects in our program Aimport java.sql.*; Bimport java.util.*; C import java.io.*; Dimport java.net.*;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

To what extent is public speaking similar to conversation?

Answered: 1 week ago

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Define capital structure.

Answered: 1 week ago

Question

Define and measure service productivity.

Answered: 1 week ago