1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Westkost [7]
3 years ago
14

a. Show the output of the following program: 1: public class Test { 2: public static void main ( String [] args ) { 3: A a = new

A( 3 ); 4: } 5: } 6: 7: class A extends B { 8: public A ( int t ) { 9: System.out.println( "A's constructor is invoked" ); 10: } 11: } 12: 13: class B { 14: public B () { 15: System.out.println( "B's constructor is invoked" ); 16: } 17: } b. Is the no-arg constructor of Object invoked when new A(3) is invoked? 6. Indicate true or false for the follow statements: a. You can always successfully cast an instance of a subclass to a superclass. b. You can always successfully cast an instance of a superclass to a subclass. 7. What's wrong with the following code? 1: public class Test { 2: public static void main ( String [] args ) { 3: Object fruit = new Fruit(); 4: Object apple = (Apple) fruit; 5: } 6: } 7: 8: class Apple extends Fruit { 9: } 10: 11: class Fruit { 12: } 8. When overriding the equals method, a common mistake is mistyping its signature in the subclass. For example, the equals method is incorrectly written as equals (Circle circle) as shown in (a) below. It should be written as equals(Object circle), as shown in (b) below. Show the output of running class Test using the Circle class first from (a), and then from (b). Explain the output. 1: public class Test { 2: public static void main ( String [] args ) { 3: Object circle1 = new Circle(); 4: Object circle2 = new Circle(); 5: System.out.println( circle1.equals( circle2 ) );
Computers and Technology
1 answer:
faust18 [17]3 years ago
3 0

Answer:

See attached file.

Explanation:

See attached file.

Download txt
You might be interested in
Should I learn Python, C++, C# or VB to start off programming games for Windows. Open to other language recommendations as well!
Svetllana [295]
In theory, you can of course use any language you like, but there are a few commonly used ones.
From your list it would be c++ or c#, because if you actually have the interest long term then those will be the languages used by the various "big"/well known/used engines.
I would suggest c#, because it can be used with the Unity engine, which has an enormous community with help resources especially to start out and learn to program or game development.
On the other hand I would also suggest JavaScript. It isn't used for any of the big title development, but for all the *.io games like slither and so on. When looking at such games you will quickly notice that they are generally much simpler (for example 2D not 3D), because game engines are just simpler in JavaScript. While this is obviously limiting it might help to get something simple actually working, instead of getting stuck in extra complexities and additional features until you lose your motivation.
The basic programming you learn is still the same, so after you have learned a language you can quickly pick up most others.
<span />
7 0
3 years ago
Develop an sec (single error correction) code for a 16-bit data word. generate the code for the data word 0101000000111001. show
natita [175]

Answer:

010100000001101000101

Explanation:

When an error occurs in data bits, the SEC code is used to determine where the error took place. 5 check-bits are needed to generate SEC code for 16-bits data word. The check bits are:

C16=0, C8=0, C4=0,C2=0,C1=1

Therefore the SEC code is 010100000001101000101

7 0
3 years ago
Read 2 more answers
Which of the following statements is true of a time management plan? It is work in progress that need to be altered many times?
marusya05 [52]
Cake cake cake cake
3 0
3 years ago
Meteoroids are small space rocks. They are usually pieces of asteroids or comets. Meteoroids orbit the sun like asteroids and co
Angelina_Jolie [31]
B is your answer meteoroids are small space rocks they are usually pieces of asteroids or comets
4 0
2 years ago
A USB is used for _________.[ pick the best answer that makes sense]
Nookie1986 [14]
<span>B) storing information and documents, pictures</span>
4 0
3 years ago
Read 2 more answers
Other questions:
  • To find a webpage, the user of a search engine would simply enter a word or phrase in the resource's text box. what is the term
    11·1 answer
  • If you “bury” a story on Digg, what have you done
    10·1 answer
  • What information medium is used to access information from the Internet in the form of HTML pages?
    12·1 answer
  • On laptops with a smart card reader installed, where is the smart card reader usually located?
    13·1 answer
  • What is an activity that can help you enhance the appearance of your computer’s desktop?
    13·1 answer
  • Choose the HTML5 element below that is used to configure an area on a web page that can stand on its own and could potentially b
    5·1 answer
  • Data is best described as
    10·2 answers
  • True or False The two types of general construction projects are residential for homes or dwellings and commercial for a commerc
    7·1 answer
  • Five plus six is equal to?​
    10·2 answers
  • What is syllabus of diploma in computer after class 10​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!