Java Specialist Technical Assessment
Java Specialist Technical Assessment
1. Write a Java Program to reverse a string without using String inbuilt function
Answer:
import java.util.Scanner;
Answer: ^[0-9]{6}[0-9A-Za-z]{6}$
Answer:
6. Write a query to extract a list of students who have the n-th score rank.
Condition:
a. Output: student’s full name, advisor’s full name & score
b. Business Logic:
■ Same score consider having same rank (e.q.: In below sample 2
students have the same score of 85, they both consider as 1st rank)
■ If nobody have n-th rank the query return null
table_name: student
student_id first_name last_name advisor_id
1 Tanisha Blake 2
2 Jess Goldsmith NULL
3 Tracy Wu 3
4 Alvin Grand 1
5 Felix Zimmermann 2
Answer:
class Main{
public static void DoPrint( Primary o ) {
o.Print();
}
public static void main(String[] args) {
Primary x = new Primary();
Primary y = new Secondary();
Secondary z = new Secondary();
DoPrint(x);
DoPrint(y);
DoPrint(z);
}
}
Answer:
PrimarySecondarySecondary
class Parent {
public void Print() {
System.out.println("Parent's Print()");
}
}
Answer:
Son Print()
Grandkid's Print()
9. What’s the output of the below java program?
class Main {
public static void main(String[] args) {
Secondary b = new Secondary();
b.show();
}
}
class Primary{
final public void show() {
System.out.println("Primary::show() called");
}
}
Answer: error
Answer: error