Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
Drew G.
Developer Intern at Liberty Mutual Insurance, Founder of Clockwise App, Chegg Computer Science Tutor
Tutor Satisfaction Guarantee
PHP Programming
TutorMe
Question:

Describe how I could use PHP to retrieve records from a database and return them back to my client application. Denote key steps or commands.

Drew G.
Answer:

Since PHP is a server side programming language, it has the ability to act as a middleman service between a database and a client application. You could use PHP to connect to a database, run a query, retrieve results, encode the results, and return them back to a client application. For example, if I wanted to return the first name of all employees in a Employee table to my application, I would follow a series of steps: 1. Connect to the database using mysql connect 2. Create and run a query like "SELECT firstName from Employee" using a method like mysql_query 3. Fetch the results using a method like mysql_fetch_array 4. Encode the results to send back in a JSON format using json_encode 5. Return the results back to the client application using the echo command

Java Programming
TutorMe
Question:

What is inheritance in Java and how can inheritance be implemented within a class? Give a short example.

Drew G.
Answer:

Inheritance in Java is when a class "inherits" variables and methods from a super class in order to abstract code and separate overarching functionality. To implement inheritance in Java you can use the "extends" keyword which specifies a relationship between a class and its superclass. The super class contains methods and variables that can be used by several classes that share similar functionality. An example is if you created a superclass Vehicle and it had a drive method. Then you could create classes Truck, Van, and Bus which could all extend the Vehicle class and use the drive method as well as any related variables. Since Truck, Van, and Bus are all types of Vehicles, they can all utilize the drive method and share that functionality in an abstract way.

Android Programming
TutorMe
Question:

In order to create navigation between "pages" in an android app, what class object is used and how can you pass data between pages?

Drew G.
Answer:

The main method of navigating between "pages" in Android is by using the Intent class navigate between Activities. The Activity class represents a "page" lifecycle in android and in order to move from one Activity to another you can use an Intent to move from one context to another. In order to pass data between Activities you can put extras on the intent and then get the extras in the recipient activity. Extras are data you can set in a map structure format to an intent. You add an extra by using the putExtra method and to use the extra you can use the getExtra method.

Send a message explaining your
needs and Drew will reply soon.
Contact Drew
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.