Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help with Java questions Which of the following statements are syntactically INCORRECT (i.e. select statements with compiler error)? A. int arr[10]; B. int x

please help with Java questionsimage text in transcribedimage text in transcribedimage text in transcribed

Which of the following statements are syntactically INCORRECT (i.e. select statements with compiler error)? A. int arr[10]; B. int x = new int; oc. import java.lang. String; OD. int x,y[]; OE. private void doSomething(int a, int ... args, int b) { } OF. final x = 0; Java's static member variables have the following properties (i.e. select correct statements): |A. The value of each static variable is shared amongst all instance B. A separate copy of each static member is created for every instance. C. Static variable types are either primitive or reference OD. The value of a static variable cannot change once initialized QUESTION 3 + Write the definition of the a public class named Wallet with only the seven members shown Wallet in the UML diagram (setters are NOT required). Ensure the following: - id: int 1) The default constructor must invoke the non-default constructor. Set id to 0 and name to name: String 11) main(Q) performs the following: + Wallet ( a. Using the Scanner class, prompt the user to enter one string value for name. Spaces are + Wallet (int, String) allowed as part of name. +getId(): int b. Generate a random number between 500 and 1000. This will be used for id. + getName(): String + main(String[]) c. Declare an instance of type Wallet and ensure id and name receive the values from the previous steps. d. Using the printf method and the getters of class Wallet, print the information of the instance. Format the output as follows and note that the getId() needs attention since it returns an int but printed as a floating- point number. ID: value of id with 3 digits after the decimal (must use format specifiers) Name;

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago