Question & Answer: xplain Why at the end ot each and every answer 0-1(7 marks): select only one choice in the following 1. The keyword that is…..

xplain Why at the end ot each and every answer 0-1(7 marks): select only one choice in the following 1. The keyword that is used to let the Field can be accessed by class Name and n to create an object: a)void b)private c)public d)static 2. Many methods with the same name is known as: a)method calling b)returning c)overloading d)dupli 3. What is constructor? One ofthe follwing is False a) Constructor cannot be overloaded b) Constructor does not have returning value. c) Constructor have same name of its class name. d) Constructor can be may have parameters. 4. Given the following 2 methods, are considered as a correct overloaded methods public static void checkID(int id) public static boolean checkID(int x) a)true b)false 5. Given a class Student, and array of Students S, then one of the following stateme used to change the age of the 3rd student in S: a) S[3]·Age 20; b) S[2]·Age d) None; = 20; = 6. One of the following statements prints out the last element in B Array: a) System.out.printin( B[B.length])

media%2F5cd%2F5cdaf290-9c4a-4735-8e50-53

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: xplain Why at the end ot each and every answer 0-1(7 marks): select only one choice in the following 1. The keyword that is…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

media%2Fb64%2Fb642526f-cd16-4b60-b1f8-81

media%2Fefc%2Fefc5e87b-aa21-46de-9b40-d2

media%2Fe7e%2Fe7e59a57-4576-4b15-bfd5-5a

media%2Fca2%2Fca20503d-4984-4eec-b27a-5c

explain why all

xplain Why at the end ot each and every answer 0-1(7 marks): select only one choice in the following 1. The keyword that is used to let the “Field” can be accessed by class Name and n to create an object: a)void b)private c)public d)static 2. Many methods with the same name is known as: a)method calling b)returning c)overloading d)dupli 3. What is constructor? One ofthe follwing is False a) Constructor cannot be overloaded b) Constructor does not have returning value. c) Constructor have same name of its class name. d) Constructor can be may have parameters. 4. Given the following 2 methods, are considered as a correct overloaded methods public static void checkID(int id) public static boolean checkID(int x) a)true b)false 5. Given a class Student, and array of Students S, then one of the following stateme used to change the age of the 3rd student in S: a) S[3]·Age 20; b) S[2]·Age d) None; = 20; = 6. One of the following statements prints out the last element in B Array: a) System.out.printin( B[B.length])

Expert Answer

 

1) D) static

Making class members (variables) static allows us to use these members just by using class name without instantiating.

2) C) Overloading

Function overloading refers to creating more than one function under same name

3) A) A constructor cannot be overloaded

This is false as we are allowed to overload the constructor ( overload means having more than one constructor )

4) B) false

Because for methods to be overloaded there should be difference in the type of parameters of the function

5) B) S[2].Age = 20;

Because in java indexing of array start from 0 .

6) B) System.out.println( B[B.length -1 ] );

array.length gives length of the array but the maximum index is length -1 because indexing starts from 0

7) D) 50

because it uses conditional operator (condition) ? True : False ;  If the condition is true then statement written after : will get executed and if the condition is True then the statement before : will be executed

Q 2) int A [] = { 2, 4, 6, 8, 10, 12 };

Q 3) OUTPUT :-

//1 – green

//2 – light green

//3 – light green

//4 – Yellow

//5 – red

//6 – red

Q) 4 )

// 1. Constructor with 0-parameters (that assigns nothing)
public Animal() {

this.name = “”;
}
// 2. Constructor that assigns all the variables
public Animal(String name, int legs) {
this.name = name;
this.legs = legs;
}

Grand Paper Writers
Order NOW For A 10% Discount!
Pages (550 words)
Approximate price: -

Our Advantages

Plagiarism Free Papers

All papers are written by the best professional writers to ensure 100% originality. We always provide plagiarism reports whenever we deliver completed papers.

Free Revisions

All papers by Grand Paper Writers are completed and submitted on time. This timely delivery of papers gives you time to go through the paper before the official deadline.

Title-page

As an additional service, we will provide a title page that precedes the contents of your paper. Here, you will provide your personal details.

Bibliography

We also ensure that we provide an extra page for the references or bibliographies following referencing rules.

Originality & Security

At Grandpaperwriters.com, we guarantee students for the provision of security and original work. All your personal information is handled with confidentiality and is not shared with third parties. Additionally, we ensure that we provide original content with accompanying plagiarism reports to show originality.

24/7 Customer Support

Our customer support team is always available 24/7 to provide instant responses to any queries raised by students.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Grandpaperwriters.com has the best professional essay writers for quality services.

Pricing

Flexible Pricing

Here, a Grandpaperwriters.com, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.

Communication

Admission Help & Client-Writer Contact

Grandpaperwriters.com provides an interactive portal where students can communicate directly to their writers.

Deadlines

Paper Submission

Here, a Grandpaperwriters.com, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.

Reviews

Customer Feedback

Grandpaperwriters.com appreciates feedback from our clients to help us improve the delivery of essay writing services. As such, we are constantly changing our policies to ensure maximum customer and writer satisfaction.