Tutor profile: Vandana V.
Subject: Java Programming
I have a class called CryptoKeyGenerator The class has public methods and fields. Since the class has public methods, it is possible for a user to extend the CryptoKeyGenerator and make their own version CryptoKeyGenerator. I want to ensure that users don't create their own version of crypto key generator by extending my class. How can I achieve this?
This can be achieved by adding the "Final" access modifier to the class. A Final class cannot be extended. Thus, we can prevent inheritance of CryptoKeyGenerator by marking the class as Final. Example: "String" Class. "String" class cannot be extended, but its public methods can be accessed from another class.
Subject: Basic Math
Amy has two pieces of paper. One piece is 30 inches long and the other piece is 45 inches long. She wants to cut both pieces into strips of equal length that are as long as possible. What is the maximum length of the strip?
If we have to cut the 30 inches paper into equal strips, the the strip length has to be a factor of 30. Similarly for 45 inches of paper, the length has to be a factor of 45. Since we are splitting both the papers into equal lengths , the length of the strip should be a factor of 30 as well as 45. The question is to find the maximum length, hence, HCF (Highest Common Factor) to determine the solution i.e. HCF of 30 and 45 = 15.
What will be the result of a cross join of two tables when one of the tables is empty (no rows)?
It will return 0 rows. a cross join with an empty table (or result set) results in an empty table (M x N; where 'M' is the number of rows in table 1 and 'N' is the number of rows in table 2; hence M x 0 = 0)
needs and Vandana will reply soon.