Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

Inter. Programming

QuestionAnswer
What keyword is used when calling a parent constructor in inheritance? Super
Explain the difference between linear and binary searching. Linear goes through each element one at a time while binary divides the search pool by two until the desired item is reached.
Why does polymorphism work? Because method binding occurs at run time.
Why do we program to interfaces? Reduces programming errors Communicates design Supports obstruction and encapsulation Increases development, integration, and system testing
What is the difference between a class and an object? A class is a blueprint.
What keyword is used to instantiate an object? New
Why doesn’t Java support multiple inheritance? Multiple inheritance complicates the design and creates problems during casting, constructor chaining, etc.
Can we override static method in Java inside a subclass? No, we can’t override a static method in java but it’s not a compile time error to declare exactly the same method in a sub-class, that’s called method hiding in Java
Does the following code compile? Interface Ifruit { Public string TYPE = “Apple”} Class Fruit implements Ifruit {} Public class application { Public static void main (String [] args) { System.out.print (Fruit.TYPE); } } Yes
What are the operations of a stack? Push – adds an element to the end of the stack Pop – removes an element from the front of the stack Peek – returns a reference to the element at the front of the stack isEmpty – returns true if the stack empty, returns false
What is the difference between a full and complete tree? Full – if all leaves of the tree are at the same height and every non-leaf node has exactly n children Complete - if it is full, or full to the next to last level will all leaves at the bottom level on the left side of the tree
How do you enable your Java class to use the API stack, queue, and LinkedList class? Import java.util.stack; Import java.util.Queue; Import java.util.LinkedList;
Why can Java be ran on any machine? Byte code is OS independent
What happens when one class is assigned to another? The pointer is copied
When does the garbage collector clear things from ram? When there are no pointers to it
In what ways might a thrown exception be handled? It can be ignored You can use a try-catch statement Handled higher in the method-calling hierarchy
What is the order of the search in a binary tree? O(logn)
What is the pseudocode of the preorder? Visit node Left child Traverse right child
What is the characteristic behavior of a stack? List in First out (LIFO)
Describe the comparable interface. The Comparable interface contains a single method called compareTo, which should return an integer that is less than zero, equal to zero, or greater than zero if the executing object is <, =, or < the object to which it is being compared
What is an off-by-one error? How does it relate to arrays? An off-by-one error occurs when a program’s logic exceeds the boundary of an array by one. These errors include forgetting to process a boundary element, as well as attempting to process a non-existent element.
What is the characteristic behavior of a queue? First in First out (FIFO)
What make your variables private? Protect your variable from being manipulated by an unauthorized third party
Why is the stack trace useful to programmers but not end user? To the programmer the stack trace gives him an idea of what broke the program but to the user it is just a meaningless of words
Explain the relationship between a parent and a child class Is-a relationship
What is the use of abstract class? Generic concept in a class hierarchy
What is the use if the protected modifier? Maintain some level of encapsulation while using inheritance
What is the name of the node that has no children? A leaf
What is overloading? Having multiple methods with the same name
Are exceptions considered objects? Yes, they are objects that represent unusual or invalid processing
How is it possible to declare dogs as a Queue and construct it as LinkedList in the following? Private static Queue<Dog> dogs = new LinkedList(); Polymorphism via Interfaces: an interface reference variable can refer to any object of any class that implements that interface. By declaring dogs as type Queue, we restrict method calls to only those defined for the Queue interface.
Which uses LIFO, and which uses FIFO? Queue or stack? And what does each mean? Queue uses FIFO (First in First out). In a queue objects are added to the rear, removed from the front. Stack uses LIFO (Last in First out). In a stack objects are added at the top, removed from the top.
Why do we use static methods? Why do we use generic methods? We use static methods because it’s a utility method and no instance (object) is necessary. We use generic methods because the method can apply to many types.
What are pointers? Addresses in memory
Why do we provide a buffer for IO? It is slow compared to computations
Why can a child be constructed from a parent’s constructor? Inheritance, the child is the parent
Created by: bridget1995
Popular Science sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards