1 What is a difference between override and new when it comes to inheritance?
2 What is the difference between List<type> and ArrayList? AND Which one should you use and why?
3. If I have a file test.txt, and have committed it to the git repository using: $ git commit test.txt Then made some changes, what command (or option) do you use to get the original file back (ie restore the contents of the committed file)?
4 What command (or option) do you use to initialize a directory as a git repository?
5. List 2 decentrialized source code managment systems
6. What is the purpose of source code management systems?
7. Would this code work? Why or why not?
intval = 5;
Textbox1.Text = val;
8.... Create an example where you have a base class A and a derived class B. class A has a method called func which has the following prototype – 3pt:
public virtual void func()
Create class B such that it replaces the functionality of the func method with new functionality.
1)
Override: When a method of a base class is overridden in a derived class, the version in the derived class is used, even if the calling code didn't "know" that the object was an instance of the derived class.
New: If you use the new keyword instead of override, the method in the derived class doesn't override the method in the base class, it merely hides it.
2)
-> There's no difference between list implementations in both of your examples. There's however a difference in a way you can further use variable myList in your code.
-->When you define your list as:
-->List myList = new ArrayList();
-->you can only call methods and reference members that are defined in the List interface. If you define it as:
-->ArrayList myList = new ArrayList();
--> you'll be able to invoke ArrayList-specific methods and use ArrayList-specific members in addition to those whose definitions are inherited from List.
--> Nevertheless, when you call a method of a List interface in the first example, which was implemented in ArrayList, the method from ArrayList will be called (because the List interface doesn't implement any methods).
3)
$ git reset --soft HEAD^
$ ... do something else to come up with the right tree ...
$ git commit -c ORIG_HEAD
4)git-init-db(1) ============== NAME ---- git-init-db - Creates an empty Git repository SYNOPSIS -------- [verse] 'git init-db' [-q | --quiet] [--bare] [--template=] [--separate
5)
DELTA BASED VERSION CONTROL
SNAPSHOT BASED VERSION CONTROL
6)
7)Not work.
Because, we can store an int value in a variable of type int. But we can't store a int value to a text file. It won't work anyway.
8)
public clsas A{
public vertual void func( ) { }
}
public clsas B : A{
public override void func( ) { }
}
1 What is a difference between override and new when it comes to inheritance? 2 What...
give notes to what each look like and description in text form Lab#1 –Learning Some Basics applied Skills We have completed our initial install of Ubuntu and begun to feel our way around our new system. The following assignment will help you familiarize yourself with your new environment. Please use your system to test answer the following questions. After you have logged in and opened a term window... SECTION I: Simple Navigation of the file system 1. Use df command...
Homework 2: Avatar Cosmetic Description Use Decorator Pattern to design a command-line based avatar customization system for a game. The user shall select an avatar from two options: a male and a female. The user shall select various cosmetics for the avatar, including: Jacket T-shirt Jeans Shorts Sunglasses Running Shoes The system shall display the description of the avatar at the end of the customization. Example UI Welcome to the Avatar 1.0 System! Please select a cosmetic for your character:...
1. Explain the difference between the /etc/profile and the ~/.bash_profile file. Which one is executed first? 2. Edit your .bash_profile file as follows: 1. Welcome the user 2. Add your home directory to the path if it is not there 3. Set erase to the Backspace key using stty. 4. Type source .bash_profile. What is the function of the source command? 3. What is the default primary prompt? 1. Change the prompt to include the time of day and your...
Assignment Requirements
I have also attached a Class Diagram that describes the
hierarchy of the inheritance and interface behaviors . The link to
the PDF of the diagram is below
MotorVehical.pdf
Minimize File Preview
User Define Object Assignment:
Create a Intellij Project. The
Intellij project will contain three user defined
classes. The project will test two of the User Define Classes by
using the invoking each of their methods and printing the
results.
You are required to create three UML...
1. Discuss the difference between inheritance and composition. What are the advantages and disadvantages of each? Can you implement one with the other? 2.How is a class similar to a database table? How is it different? How do these similarities and differences justify the need for class models and for data models? Or do they? 3.Discuss the difference between association and composition. What are the advantages and disadvantages of each? 4.When would you apply inheritance? When would you not? Provide...
Purpose Demonstrate the ability to create and use subclasses and inheritance. This includes overriding method behaviors and using polymorphism. Assignment Create an Aircraft class that has several properties that are common to all aircraft (Ex: number of engines, seat capacity). You define the name of the Class and the actual fields. The fields MUST BE PRIVATE!!! You must define a constructor that allows you to provide at least some of the field values used for an aircraft. You must define...
Question 2 0/1 point (graded) What happens when you remove a directory using the command rm -r? You cannot remove a directory using the rm command. You permanently remove the entire directory, including all files and subdirectories. You move the entire directory to a trash folder, but it can be restored later. You get a warning message asking if you want to proceed, then you delete the directory. incorrect Answer Incorrect: Try again. Unix does not warn you before permanently...
do numbers 4-8
4. Given any directory, use the Is command to display: • all files and sub-directories starting with the letter "D" (note do not list anything in any sub-directory) • its immediate sub-directories (sub-directories only, and no other ordinary files) its immediate hidden sub-directories only - take a screenshot (#3-3) that clearly shows the command and the result. 5. Assume that the following files are in the working directory: $ ls intro notesb ref2 section 1 section3 section4b...
What if you had to write a program that would keep track of a
list of rectangles? This might be for a house painter to use in
calculating square footage of walls that need paint, or for an
advertising agency to keep track of the space available on
billboards.
The first step would be to define a class where one object
represents one rectangle's length and width. Once we have class
Rectangle, then we can make as many objects of...
1. What is the difference between 1-mode and 2-mode graph? Give an example for each. 2. List various graph data structures to store social network information. 3. What is “six degrees of separation” in the context of social networks? What is the average degree of separation for Facebook and Twitter (you can cite other studies that have reported these statistics)? 4. What is “strength of weak ties”? Explain the rationale behind this phenomenon. 5. List and describe the various centrality...