TutorMe homepage
Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
Snehil A.
Software Engineer at Microsoft
Tutor Satisfaction Guarantee
Java Programming
TutorMe
Question:

Does Java support multiple inheritances?

Snehil A.
Answer:

This is the trickiest question in Java if C++ can support direct multiple inheritances than why not Java is the argument Interviewer often give. Answer of this question is much more subtle then it looks like, because Java does support multiple inheritances of Type by allowing an interface to extend other interfaces, what Java doesn't support is multiple inheritances of implementation. This distinction also gets blur because of default method of Java 8, which now provides Java, multiple inheritances of behavior as well.

C++ Programming
TutorMe
Question:

Program to divide an integer by 4 without using ‘/’ operator.

Snehil A.
Answer:

// CPP program to divide a number by 4 // without using '/' #include<iostream> using namespace std; int main() { int n = 4; n = n >> 2; cout << n; return 0; }

C Programming
TutorMe
Question:

check if two numbers are equal without using arithmetic operators or comparison operators.

Snehil A.
Answer:

The simplest solution for this is using Bitwise XOR operator (^). We know that, for two equal numbers XOR operator returns 0. We will use this trick to solve this problem. // C program to check if two numbers are equal // without using arithmetic operators or // comparison operators #include<stdio.h> int main() { int x = 10; int y = 10; if ( !(x ^ y) ) printf(" x is equal to y "); else printf(" x is not equal to y "); return 0; }

Send a message explaining your
needs and Snehil will reply soon.
Contact Snehil
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.