Skip to content

YomZsamora/Java-Interview-Questions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Java Technical Interview Questions

Java

  • What is the JVM? A virtual machine that enables a computer to run Java programs and compiles it to Java bytecode.
  • Define code compilation? The conversion of a programming language or high level language into machine language that's easily undestood by the machine.
  • What is a constuctor? A method that’s called when an instance of an object is created.
  • What is the naming convention of variables in java? All variable names must begin with a letter, an underscore or a dollar sign.
  • What is an annotation and give an example. This is metadata used to provide data about a program that is not part of the program itself.
  • What is the difference between '==' and equals() when comparing Strings? The equals() method compares the "value" inside String instances even if the two objects references refer to the same String instance or not while '==' compares the value of two object references to see whether they refer to the same String instance.
  • What are the 8 primitive types in Java? 1. int 2. char 3. boolean 4. long 5. float 6. double 7. byte 8. short
  • What is the difference between primitives and wrapper classes and when can we use each? Primitives dont belong to a class and therefore we cannot call methods on them but wrapper classes can be used to convert these primitives into objects that may now allow us to call methods on them. Wrapper classes can be used only when we want to call methods on primitives otherwise, use primitives.
  • Define Encapsulation and outline its benefits. It is one of the four fundamental OOP concepts and is used for wrapping variables and methods together as a single unit. The advantage of this is that a class can have total control over what is stored in its fields.
  • Do objects get passed by reference or value in Java? Elaborate on that.
  • Explain the four OOP principles.
  • What is the difference between Abstract classes and Interfaces?
  • Is it possible to implement multiple inheritance in Java?
  • What is serialization? How do you implement it?
  • What are anonymous classes?
  • What does it means to say that a String is immutable?
  • What is the difference between method overloading and method overriding?
  • What are the access modifiers you know? What does each one do?
  • Do objects get passed by reference or value in Java? Elaborate on that.
  • What the difference between local, instance and class variables?
  • What is Dependency Injection?
  • What does the static word mean in Java? Can a static method be overridden in Java?
  • When is a static block run?
  • What is reflection?
  • How does the try{} catch{} finally{}
  • What is garbage collection? How does it work?
  • What is memory leak and how does Java handle it?
  • What does the keyword synchronized mean?
  • Explain Generics in Java

Web Development

  • What is the difference between a GET and POST request? Post submits data to be processed to the identified resource while GET requests / retrieves data from thespecified resource.
  • What is a URI? URI stands for Uniform Resource Identifier and is used for identifying / locating resources using the URL.
  • Differenciate between a client and host.
  • What is the difference between HTTP and HTTPS? HTTP stands for Hypertext Transfer Protocol and uses TCP (Transmission Control Protocol) over port 80 to send and receive data packets over the web while HTTPs is like a more secure version of HTTP that also uses TCP to send and receive data packets but over port 443 within a connection encrypted by Transport Layer Security (TLS).
  • Point out these components(query, host, port, protocol, path ) in the following URL https://127.0.0.1:4200/login/a=bx?c
  • What is an Internet Protocol?

Android

  • What are the four main components of an Android Application? 1. Activities 2. Broadcast Receivers 3. Content Providers 4. Services
  • What is the purpose of a package name?
  • What is the purpose of Android Virtual Device?

About

A list of technical questions I've gathered to test knowledge of Java and Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published