Add office photos
Engaged Employer

Brane Enterprises

2.0
based on 764 Reviews
Filter interviews by

Pllum Legno Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations
Q1. What is a static variable and a static method in Java?
Ans.

Static variables and methods belong to the class rather than instances of the class.

  • Static variables are shared among all instances of a class.

  • Static methods can be called without creating an instance of the class.

  • Example: public static int count = 0; public static void incrementCount() { count++; }

Add your answer
Q2. What is the difference between a For loop and a While loop?
Ans.

For loop is used when the number of iterations is known, while While loop is used when the condition is true.

  • For loop is used when the number of iterations is known beforehand.

  • While loop is used when the condition is true.

  • For loop has initialization, condition, and increment/decrement in one line.

  • While loop only has a condition to check before each iteration.

  • Example: for(int i=0; i<5; i++) { //code }

  • Example: int i = 0; while(i < 5) { //code i++; }

Add your answer
Q3. What is a do-while loop?
Ans.

A do-while loop is a control flow statement that executes a block of code at least once, and then repeatedly as long as a specified condition is true.

  • The code block is executed first before checking the condition.

  • The condition is checked after the code block is executed, and if it is true, the code block is executed again.

  • The loop continues until the condition becomes false.

  • Example: do { System.out.println('Hello'); } while (condition);

Add your answer

Q4. What is static variable and method

Ans.

Static variables and methods belong to the class rather than the instance of the class.

  • Static variables are shared among all instances of the class

  • Static methods can be called without creating an instance of the class

  • Static variables and methods are accessed using the class name, not an instance variable

  • Example: Math.PI is a static variable in the Math class

  • Example: Math.sqrt() is a static method in the Math class

Add your answer
Discover Pllum Legno interview dos and don'ts from real experiences

Q5. Difference between while loop and for loop

Ans.

While loop is used when the number of iterations is unknown, whereas for loop is used when the number of iterations is known.

  • While loop checks the condition before executing the code block, whereas for loop checks the condition after executing the code block

  • For loop is more concise and readable when the number of iterations is known

  • While loop is more flexible and can be used for infinite loops or when the number of iterations is not known

  • Example of while loop: while(i < 10) {...read more

Add your answer

Q6. What is do while loop

Ans.

A do while loop is a control flow statement that executes a block of code at least once, and then repeatedly executes the block, or not, depending on a given condition.

  • The loop body is executed at least once before the condition is checked

  • The loop continues to execute until the condition becomes false

  • Syntax: do { // code block } while (condition);

  • Example: do { System.out.println(i); i++; } while (i < 5);

Add your answer

Q7. Write any code

Ans.

Code to print 'Hello World' in Java

  • Create a class with a main method

  • Use System.out.println() to print 'Hello World'

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Java Developer Interview Questions from Similar Companies

3.7
 • 86 Interview Questions
3.8
 • 53 Interview Questions
3.8
 • 35 Interview Questions
3.5
 • 19 Interview Questions
3.5
 • 10 Interview Questions
3.5
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter