Learn Java: Java Basics

Topics: All about Java Basics'

Browse all answers:

What is the most important feature of Java?
What do you mean by platform independence?
What is a JVM?
 Are JVM's platform independent?
What is the difference between a JDK and a JVM?
What is a pointer and does Java support pointers?
What is the difference between procedural and object-oriented programs?
What are Encapsulation, Inheritance and Polymorphism?
What is the difference between Assignment and Initialization?
What is OOPs?
What are Class, Constructor and Primitive data types?
What is an Object and how do you allocate memory to it?
What are methods and how are they defined?
What is the use of bin and lib in JDK?
What is casting?
How many ways can an argument be passed to a subroutine and explain them?
What is the difference between an argument and a parameter?-
What is UNICODE?
What is Garbage Collection and how to call it explicitly?
What are Transient and Volatile Modifiers?
What is meant by Inheritance and what are its advantages?
What is the difference between this() and super()?
What is the difference between superclass and subclass?
What are inner class and anonymous class?
What is the difference between Integer and int?
Explain about Java Hello World Program?
Explain Java Comments?
Explain Java Data and Variables?
Explain Java Command Line Arguments?
Explain Java Arithmetic Operators?
Explain Java Assignment Operators?
Explain Java Increment and Decrement Operators?
Explain Java Relational Operators?
Explain Java Boolean Operators?
Explain Java Conditional Operators?
Explain Java Variables and Arithmetic Expressions?
What is a method?
How to make executable jar files in JDK?
Can constructor be inherited?
What are the differences between Contructors and Methods?
What are the differences between Class Methods and Instance Methods?
What are Access Specifiers?
What is final modifier?
What are the uses of final method?
What is static block?
What are static variables?
What is the difference between static and non-static variables?
What are static methods?
An empty memory space is returned so that the developers can utilize it.void returns no data type.void is not supported in JavaNone of the above
A lower precision can be assigned to a higher precision value in Java. For example a byte type data can be assigned to int type.
Which four options describe the correct default values for array elements of the types indicated?int -> 0    String -> "null"    Dog -> null    char -> '\u0000'    float -> 0.0f    boolean -> true
Which one of these lists contains only Java programming language keywords?
Which will legally declare, construct, and initialize an array?
Which is a reserved word in the Java programming language?
Which is a valid keyword in java?
Which three are legal array declarations?  int [] myScores [];    char [] myChars;    int [6] myScores;    Dog myDogs [];    Dog myDogs [7];
Which three piece of codes are equivalent to line 3?public interface Foo {     int k = 4; /* Line 3 */}    final int k = 4;    public int k = 4;    static int k = 4;    abstract int k = 4;    volatile int k = 4;    protected int k = 4;
Which one of the following will declare an array and initialize it with five numbers?
Which three are valid declarations of a char? char c1 = 064770;    char c2 = 'face';    char c3 = 0xbeef;    char c4 = \u0022;    char c5 = '\iface';    char c6 = '\uface';
 Which is the valid declarations within an interface definition?
Which one is a valid declaration of a boolean?
Which three are valid declarations of a float?   float f1 = -343;    float f2 = 3.14;    float f3 = 0x12345;    float f4 = 42e7;    float f5 = 2001.0D;    float f6 = 2.81F;
Which is a valid declarations of a String?
What is the numerical range of a char?
What is the difference between procedural and object-oriented programs?
What are Encapsulation, Inheritance and Polymorphism?
What is the difference between Assignment and Initialization?
What is OOPs?
What are Class, Constructor and Primitive data types?-
What is an Object and how do you allocate memory to it?
What is the difference between constructor and method?
What are methods and how are they defined?
What is the use of bin and lib in JDK?
What is casting?
How many ways can an argument be passed to a subroutine and explain them?
What is the difference between an argument and a parameter?
What are different types of access modifiers?
What is final, finalize() and finally?
What is UNICODE?
What is Garbage Collection and how to call it explicitly?
What is finalize() method?
What are Transient and Volatile Modifiers?
What is meant by Inheritance and what are its advantages?
What is the difference between this() and super()?
What is the difference between superclass and subclass?
What modifiers may be used with top-level class?
What is a package?
What is a reflection package?
What is interface and its use?
What is an abstract class?
What is the difference between Integer and int?
What is a cloneable interface and how many methods does it contain?
Can you have an inner class inside a method and what variables can you access?-
What is the difference between String and String Buffer?
What is the difference between Array and vector?
What is the difference between exception and error?-
What is the difference between process and thread?
What is multithreading and what are the methods for inter-thread communication and what is the class in which these methods are defined?- 
What is the class and interface in java to create thread and which is the most advantageous method?
What are the states associated in the thread?
What is synchronization?
When you will synchronize a piece of your code?
Are there any global variables in Java, which can be accessed by other part of your program?
What is the difference between applications and applets?
How does applet recognize the height and width?
When do you use codebase in applet?
How do you set security in applets?
What is an event and what are the models available for event handling?
What are the advantages of the model over the event-inheritance model?- 
What is source and listener?
What is adapter class?
What is meant by controls and what are different types of controls in AWT?- 
What is the difference between choice and list?
What is the difference between scrollbar and scrollpane?
What is a layout manager and what are different types of layout managers available in java AWT?
How are the elements of different layouts organized?
Which containers use a Border layout as their default layout?
Which containers use a Flow layout as their default layout?
What are wrapper classes?
What are Vector, Hashtable, LinkedList and Enumeration?
What is the difference between set and list?
What is a stream and what are the types of Streams and classes of the Streams?
What is an I/O filter?
What is serialization and deserialization?
What is JDBC?
What are drivers available?
What is the difference between JDBC and ODBC?-
What are the types of JDBC Driver Models and explain them?
What are the steps involved for making a connection with a database or how do you connect to a database?
What type of driver did you use in project?- 
What are the types of statements in JDBC?
How to create and call stored procedures?
What is the difference between an applet and a servlet?
Is it possible to communicate from an applet to servlet and how many ways and how?
What is internationalisation? How can you achieve in java? 
What is the default size of vector and StringBuffer? 
Which Java operator is right associative?
What is an Iterator ?
How do you traverse through a collection using its Iterator?
How do you remove elements during Iteration?
What is the difference between Enumeration and Iterator?
How is ListIterator?
What is the List interface?
What are the main implementations of the List interface ?
What are the advantages of ArrayList over arrays ?
Difference between ArrayList and Vector ?
How to obtain Array from an ArrayList ?
Why insertion and deletion in ArrayList is slow compared to LinkedList ?
Why are Iterators returned by ArrayList called Fail Fast ?
How do you decide when to use ArrayList and When to use LinkedList?
What is the Set interface ?
What are the main Implementations of the Set interface ?
What is a HashSet ?
What is a TreeSet ?
What is an EnumSet ?
Difference between HashSet and TreeSet ?
What is a Map ?
What are the main Implementations of the Map interface ?
What is a TreeMap ?
How do you decide when to use HashMap and when to use TreeMap ?
Difference between HashMap and Hashtable ?
How does a Hashtable internally maintain the key-value pairs?
What Are the different Collection Views That Maps Provide?
What is a KeySet View ?
What is a Values Collection View ?
What is an EntrySet View ?
How do you sort an ArrayList (or any list) of user-defined objects ?
What is the Comparable interface ?
What are the differences between the Comparable and Comparator interfaces ?
What are static methods?
Can an Interface have an inner class?
Can we define private and protected modifiers for variables in interfaces? 
What is Externalizable?
What modifiers are allowed for methods in an Interface?
What is a local, member and a class variable?
What are the different identifier states of a Thread?
What are some alternatives to inheritance?
Why isn’t there operator overloading?
What does it mean that a method or field is “static”?
How do I convert a numeric IP address like 192.18.97.39 into a hostname like java.sun.com?
Why do threads block on I/O?
What is synchronization and why is it important?
Is null a keyword?
Which characters may be used as the second character of an identifier,but not as the first character of an identifier
What modifiers may be used with an inner class that is a member of an outer class?
How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters
What are wrapped classes?
What restrictions are placed on the location of a package statement within a source code file?
What is the difference between preemptive scheduling and time slicing
What is a native method?
What are order of precedence and associativity, and how are they used?
What is the catch or declare rule for method declarations?
Can an anonymous class be declared as implementing an interface and extending a class? 
What is the range of the char type?
What is immutable object? Can you write immutable object?
Does all property of immutable object needs to be final?
What is the difference between creating String as new() and literal?
How does substring () inside String works?
Which two method you need to implement for key Object in HashMap ?
Where does these  two method comes in picture during get operation?
How do you handle error condition while writing stored procedure or accessing stored procedure from java?
 What is difference between Executor.submit() and Executer.execute() method ?
What is the difference between factory and abstract factory pattern?
What is Singleton? is it better to make whole method synchronized or only critical section synchronized ?
 Can you write critical section code for singleton?
Can you write code for iterating over hashmap in Java 4 and Java 5 ?
 When do you override hashcode and equals() ?
What will be the problem if you don't override hashcode() method ?
Is it better to synchronize critical section of getInstance() method or whole getInstance() method ?
 What is the difference when String is gets created using literal or new() operator ?
Does not overriding hashcode() method has any performance implication ?
What’s wrong using HashMap in multithreaded environment? When get() method go to infinite loop ?
Give a simplest way to find out the time a method takes for execution without using any profiling tool?
What do you mean by platform independence? 
Are JVM's platform independent?
What is a JVM?
What is the difference between a JDK and a JVM?
What is a pointer and does Java support pointers? 
What is the base class of all classes?
Does Java support multiple inheritance?
is Java a pure object oriented language? 
Are arrays primitive data types? 
What is difference between Path and Classpath? 
What are local variables? 
What are instance variables? 
How to define a constant variable in Java? 
Should a main method be compulsorily declared in all java classes?
What is the return type of the main method?
Why is the main method declared static?
What is the arguement of main method?
Can a main method be overloaded? 
Can a main method be declared final? 
Does the order of public and static declaration matter in main method?
Can a source file contain more than one Class declaration?
What is a package?
Which package is imported by default?
Can a class declared as private be accessed outside it's package?
Can a class be declared as protected?