In the following code, the classes A and B are in different packages. If the question marks in (a) are replaced by blanks, can class B be compiled? If the question marks are replaced by private, can class B be compiled? If the question marks are replaced by protected, can class B be compiled?
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
Additional Engineering Textbook Solutions
Starting Out With Visual Basic (8th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Concepts Of Programming Languages
Introduction To Programming Using Visual Basic (11th Edition)
- Write a code in Java, test and document (at least) three classes – a CourseWorkStudent class, aResearchStudent class (which both derive from the Student class) and a Client program. Make sure the rules below are followed for the code. Please specify how to get the code to work in NetBeans IDE. For coursework students:(a) There are two assignments, each marked out of a maximum of 100 marks and equally weighted.The marks for each assignment are recorded separately.(b) There is weekly practical work. The marks for this component are recorded as a total markobtained (marked out of a maximum of 20 marks) for all practical work demonstrated during thesemester.(c) There is one final examination that is marked out of a maximum of 100 marks and recordedseparately.(d) An overall mark (to be calculated within the class)(e) A final grade, which is a string (think of a way to avoid code duplication for calculating this)The final grade, for coursework students, is to be awarded on the basis of an…arrow_forwardplease answer with outputarrow_forwardWrite a class named NameAndCount for recording a String data name and an int data named count. A constructor for the class takes two values, one for the name and the other for the count, and stores the two values in the instance variables. The class must be comparable, with the declaration of implements Comparable<NameAndCount>. The class has a “getter” for the name, named getName, and a “getter” for the count, named count. For “setters”, there is a method named increment that increases the value of count by 1. There is another instance method equals, which receives a String data as its parameter, and returns a boolean value indicating whether or not the contents of the String data is equal to the contents of name. Additionally, the class must implement the compareTo method, which returns the result of comparing the values of count. please write java code for above questionarrow_forward
- Write a class named NameAndCount for recording a String data name and an int data named count. A constructor for the class takes two values, one for the name and the other for the count, and stores the two values in the instance variables. The class must be comparable, with the declaration of implements Comparable<NameAndCount>. The class has a “getter” for the name, named getName, and a “getter” for the count, named count. For “setters”, there is a method named increment that increases the value of count by 1. There is another instance method equals, which receives a String data as its parameter, and returns a boolean value indicating whether or not the contents of the String data is equal to the contents of name. Additionally, the class must implement the compareTo method, which returns the result of comparing the values of count. please write java code for above question and please send me the screenshot of the output formatarrow_forwardWrite one word answers for the following: a.On compiling a file with the name “Demo.java” having a single class named Test, what is the name of the bytecode file that is created? b.When a method in asubclass has exactly the same signature as a method in the superclass, what is it known as?arrow_forwardUsing the card.java class file, write a program to simulate a Deck of Cards. See Programming Project 8.7 (PP 8.7) from page 403 on textbook for a description of what your program needs to do. Note that although the book description of the problem states that you should write the Card class, I do not want you to do that. You must use the Card file exactly as it is provided (NO modifications) and only write the DeckOfCards and Driver classes. public class Card{public final static int ACE = 1;public final static int TWO = 2;public final static int THREE = 3;public final static int FOUR = 4;public final static int FIVE = 5;public final static int SIX = 6;public final static int SEVEN = 7;public final static int EIGHT = 8;public final static int NINE = 9;public final static int TEN = 10;public final static int JACK = 11;public final static int QUEEN = 12;public final static int KING = 13; public final static int CLUBS = 1;public final static int DIAMONDS = 2;public final static int…arrow_forward
- Use java and use proper code indentation.arrow_forwardIn Java, given the parameters:I'm having a bit of trouble how to check if the inputs would be null for Constructor A and how to create the copy constructor for Constructor C. Otherwise, is the rest of the program fine for the specific instructions?arrow_forwardWrite a Java program that consists of at least three classes for Students, Employees and Courses registration in University. The program should be fully documented, and the following concepts should be applied: Defining a constructor with and without arguments. Use the setter, getter and toString methods Sending an object/s to a method and returning it as a return value. Defining array of objects and using loop/s and Scanner object/s for data entry. Defining the main method that integrates the whole project.arrow_forward
- Using JAVA write a code to: Implement a class Person with a name and a year of birth. Add a class Student that inherits from Person and has a major. Add a class Instructor that inherits from Person and has a salary. For each class, write the needed constructors, getters, setters, and a toString method that stringifies the instance variables in a readable format. Supply a test program that instantiates an instance of each class and exercises each method defined for the class.arrow_forwardA PMC (private military contractor) has contacted you to help write code to control the Security Checkpoints for their company. You must create (in C++) a Checkpoint class with a hidden attributes (Authorized, Guest, Unauthorized), two constructors (a default that sets all access levels to false and an overloaded that sets Authorized and Unauthorized to false and Guest to true for testing purposes) and a method that changes the access level to the next in the sequence (Authorized – Guest – Unauthorized).arrow_forwardin Javaarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education