What will be the output of the following pseudocode?
Integer p, q, r
Set p = 4, q = 4, r = 8
q = 8 + r
if((p + q) < (q-p))
if((p ^ q ^ r) < (q + r + p))
r = (11 & 7) ^ p
p = (11 ^ 8) + q
End if
q = (p + q) + r
End if
q = (p + q) + r
Print p + q + r
Integer p, q, r
Set p = 4, q = 4, r = 8
q = 8 + r
if((p + q) < (q-p))
if((p ^ q ^ r) < (q + r + p))
r = (11 & 7) ^ p
p = (11 ^ 8) + q
End if
q = (p + q) + r
End if
q = (p + q) + r
Print p + q + r
Will the following code compile correctly?
abstract class AirPlane{
abstract void fly();
void land(){//Line 3
System.out.println("Landing ........");
}
}
class AirJet extends AirPlane{
AirJet(){
super();//Line 9
}
void fly(){
System.out.println("Flying ........");
}
}
abstract class AirPlane{
abstract void fly();
void land(){//Line 3
System.out.println("Landing ........");
}
}
class AirJet extends AirPlane{
AirJet(){
super();//Line 9
}
void fly(){
System.out.println("Flying ........");
}
}
What will be the output of the following code?
class A{
int i=10;
public void printValue(){
System.out.print("Value-A ");
}
}
class B extends A{
int i=12;
public void printValue(){
System.out.print("Value-B ");
}
}
public class Main
{
public static void main(String[] args) {
A a=new B();
a.printValue();
System.out.println(a.i);
}
}
class A{
int i=10;
public void printValue(){
System.out.print("Value-A ");
}
}
class B extends A{
int i=12;
public void printValue(){
System.out.print("Value-B ");
}
}
public class Main
{
public static void main(String[] args) {
A a=new B();
a.printValue();
System.out.println(a.i);
}
}
What will be the output?
public class Main
{
public static void main(String[] args) {
int num1, num2;
try{
num1 = 0;
num2 = 62/num1;
System.out.println("Try block message");
System.exit(0);
} catch(ArithmeticException e){
System.out.println("Error : Don't divide a number by zero");
System.exit(0);
} finally {
System.out.println("Give another number of num1");
}
}
}
public class Main
{
public static void main(String[] args) {
int num1, num2;
try{
num1 = 0;
num2 = 62/num1;
System.out.println("Try block message");
System.exit(0);
} catch(ArithmeticException e){
System.out.println("Error : Don't divide a number by zero");
System.exit(0);
} finally {
System.out.println("Give another number of num1");
}
}
}
Choose the correct option.
Which code segment should be used in place of missing Statement in the below code such that it displays the list of all root directories of the available system?
// Missing Statement
for(int i=0;i<dirs.length;i++)
System.out.println("Root["+i+"] : "+dirs[i]);
Which code segment should be used in place of missing Statement in the below code such that it displays the list of all root directories of the available system?
// Missing Statement
for(int i=0;i<dirs.length;i++)
System.out.println("Root["+i+"] : "+dirs[i]);
What is true about the WITH GRANT OPTION clause?
Anonymous Quiz
25%
It is used to grant an object privilege on a foreign key column
30%
It allows the grantee to grant object privileges to other users and roles
14%
It required syntax for privileges
15%
It allows a grantee DBA privileges
16%
It allows privileges on specified columns of tables
Top 101 Java Interview Questions And Answers That IT Companies Ask! // D2C
https://dare2compete.com/blog/java-interview-questions
https://dare2compete.com/blog/java-interview-questions
Unstop
Unstop - Competitions, Quizzes, Hackathons, Scholarships and Internships for Students and
Corporates
Corporates
Explore student/corporate competitions & engagements for B-schools, Engineering & Graduate colleges. We are an employer branding consultant & help conceptualize & organize these engagements | Unstop (formerly Dare2Compete) - India
👍1
https://technozive-com.cdn.ampproject.org/v/s/technozive.com/web-stories/10-java-programming-skills-java-developers-can-learn-in-2022/?amp_js_v=as6&usqp=mq331AQIKAGwASCAAgM%3D#aoh=16435429818942&cap=education,swipe&csi=0&embedMode=4&lang=en&showStoryUrlInfo=0&visibilityState=visible&webview=1
https://stories.app.goo.gl/Mtj2
https://stories.app.goo.gl/Mtj2
Which of the following is true :
Anonymous Quiz
22%
An ArrayList resizes dynamically to whatever size is needed.
8%
ArrayList is a class in Java API.
10%
Classes are grouped in packages.
60%
All of these.
👍2
What is the return type of Lambda expression?
Anonymous Quiz
18%
String
30%
Object
23%
Void
30%
Function
🤔15😁1
Which Spring annotation is used to create RESTful Web services using Spring MVC.
Anonymous Quiz
70%
9%
15%
6%
🤔1