JAVA - Interview Question - Sheet1
JAVA - Interview Question - Sheet1
, Level Questions
Advanced
115 Java Program to Sort the Array in a Descending Order.
116 Java Program to Sort Names in an Alphabetical Order.
117 Java Program to Display Transpose Matrix.
118 Java Program to Search Key Elements in an Array.
119 Java Program to Accept the Marks of a Student and find Total Marks and Percentage.
120 Java program that reads a positive integer and count the number of digits.
Advanced
121 Java program that accepts three numbers and check All numbers are equal or not.
122 Java program that accepts three numbers from the user and check if numbers are in “increasing” or “decreasing” order.
123 Java program that determines a student’s grade.
124 Java program to create a simple calculator.
125 Java program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros.
126 Java program to enter the numbers till the user wants and at the end the program should display the largest and smallest numbers entered.
127 Java program to print out all Armstrong numbers between 1 to 600 using loop.
128 Java program to count total number of notes in entered amount using loop.
129 Java program to print Fibonacci series of n terms where n is input by user using loop.
130 Java program to calculate the sum of following series where n is input by user.
131 Java program to compare two array lists.
132 Java program to swap two elements in an array list.
133 Java program to join two array lists.
134 Java program to empty an array list.
135 Java program to convert a float value to absolute value.
136 Java program to accept a float value of number and return a rounded float value.
137 Write a method that overloads the talk method by taking in a name and printing “Hello” with that name.
138 Use Inheritance concept to Create a class and specify the parent class with one method, use the extends keyword in the class header of the child class with same method. create object for both class and call the method using each objects.
139 Override the taste method from the Candy class in the Chocolate class to return “tastes chocolately”. It should print “tastes sweet!” and then “tastes chocolately”.
140 Overload the greet method to just print “Hello” if not given any parameters. It should print “Hello” and then “Hello Sansa”.
141 Add a call to Pet’s brag method before printing anything in Dog’s brag method (hint: use super to call an overridden method). It should print “I have the best pet!” and then “I have the best dog”.
OOPs Concepts Programs
Create a constructor for person class with name and age as parameter. Inherit the person class by using Teacher child class. Teacher class should have constructor with three parameters (name, age,
142 degree).Use super(parm1,parm2) to call the parent’s constructor. This is especially useful to initialize inherited fields. This should print like “Dharma 30” followed by “Dhana 32 PhD”.
143 Create public getter and setter methods to the Store class so its variables can be accessed by other classes. It should print the store’s name and address and then change both and print the new values.
144 Create a program a use all the OOPs concepts under one program
145 Create a Dog subclass for the abstract Animal class with two abstract methods speak and eat. Override the abstract methods. It should print “woof” and then “num num”.