Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 12 pages
Exam (elaborations)

ITCS 1213 UNCC FINAL EXAM QUESTIONS WITH COMPLETE SOLUTION GRADED A+

Document preview thumbnail
Preview 2 out of 12 pages

ITCS 1213 UNCC FINAL EXAM Any object that can be thown as an Exception must inherit from what class? - ANSWER-Throwable n.Can a field declared as type boolean hold a value of 1? - ANSWER-No n.Can a programmer create his/her own Exception class? - ANSWER-Yes. A programmer can create their own Exception class in Java. n.Can a sub-class also be a super-class? - ANSWER-Yes, Java allows this n.Can a subclass write methods that do not appear in the superclass? - ANSWER-Yes n.Can an interface be instantiated? - ANSWER-No n.Can an interface be instantiated? - ANSWER-You can never instantiate an interface in java. n.Can an interface have fields? - ANSWER-Yes n.Can two methods in the same class definition file have the same signature? - ANSWER-No n.Can you declare fields of a class inside a method? - ANSWER-No e a for loop to execute: Is it possible to create an array in Java where the first row has 5 elements, the second row has 6 elements and the third row has 2 elements? - ANSWER-double [] [] salaries = new double [NUM_STORES][]; array[0] = new double [5]; array[1] = new double [6]; array[2] = new double [2]; n.Does a super class have to be abstract? - ANSWER-No n.Does the is-a relationship apply to classes that implement an interface? - ANSWER-No n.Does the Java compiler compile source code to machine code? - ANSWER-No, It compiles source code to byte code n.Does using the import statement make your compiled class file larger? - ANSWER-No n.Give two reasons for interfaces in the Java language. - ANSWER-To implement a list of methods and organization n.How many classes can a class directly inherit from? - ANSWER-1 n.How many classes can a given class extend? - ANSWER-one n.How many interfaces can a class implement? - ANSWER-Multiple or unlimited n.How many interfaces can another class implement - ANSWER-As many as needed n.How many public classes can a Java class file contain? - ANSWER-1 n.If a class extends an Employee class and implements a Comparable interface, what are the is-a relationships established? - ANSWER-The given class is a: is - a relationship n.If a subclass explicitly calls the constructor of the superclass, where must the call be made in the subclass constructor? - ANSWER-It will call the default if not specified n.If BankAccount( ) class has an abstract method named withDrawFunds ( ) what do you know about the SavingAccount class and the method withDrawFunds( )? - ANSWER-That the savings account class will have a method called withdraw funds n.If BankingAccount( ) has a protected method named depositFunds( ) can the CheckingAccount class override this method with a private method named depositFunds( )? - ANSWER-No because it has to be the same or less restrictive

Content preview

ITCS 1213 UNCC FINAL EXAM QUESTIONS WITH
COMPLETE SOLUTION GRADED A+



Any object that can be thown as an Exception must inherit from what class? - ANSWER-
Throwable



n.Can a field declared as type boolean hold a value of 1? - ANSWER-No



n.Can a programmer create his/her own Exception class? - ANSWER-Yes. A programmer can
create their own Exception class in Java.



n.Can a sub-class also be a super-class? - ANSWER-Yes, Java allows this



n.Can a subclass write methods that do not appear in the superclass? - ANSWER-Yes



n.Can an interface be instantiated? - ANSWER-No



n.Can an interface be instantiated? - ANSWER-You can never instantiate an interface in java.



n.Can an interface have fields? - ANSWER-Yes



n.Can two methods in the same class definition file have the same signature? - ANSWER-No



n.Can you declare fields of a class inside a method? - ANSWER-No

, n.create a for loop to execute: Is it possible to create an array in Java where the first row has 5
elements, the second row has 6 elements and the third row has 2 elements? - ANSWER-double
[] [] salaries = new double [NUM_STORES][];

array[0] = new double [5];

array[1] = new double [6];

array[2] = new double [2];



n.Does a super class have to be abstract? - ANSWER-No



n.Does the is-a relationship apply to classes that implement an interface? - ANSWER-No



n.Does the Java compiler compile source code to machine code? - ANSWER-No, It compiles
source code to byte code



n.Does using the import statement make your compiled class file larger? - ANSWER-No



n.Give two reasons for interfaces in the Java language. - ANSWER-To implement a list of
methods and organization



n.How many classes can a class directly inherit from? - ANSWER-1



n.How many classes can a given class extend? - ANSWER-one



n.How many interfaces can a class implement? - ANSWER-Multiple or unlimited



n.How many interfaces can another class implement - ANSWER-As many as needed

Document information

Uploaded on
April 2, 2025
Number of pages
12
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$15.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ExamCore
3.5
(6)
Sold
33
Followers
11
Items
1697
Last sold
1 week ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions