PONGABOXjava

SPECIAL THINGS ABOUT EVERYTHING








There are no pointers in Java.
We can overload main() method as well.
Finally block is always executed in java.
String is not a primitive data type in java.
We cannot override static methods in java.
Java uses Unicode to represent the characters.
Static methods can’t be overridden in any class.
An interface is a collection of abstract methods.
In Java, there are no destructors defined in the class.
In Java, there is not goto keyword unlike C language.
A Hashtable is synchronized, while a HashMap is not.
A Set is a Collection that cannot contain duplicate elements.
Vector is synchronized while ArrayList is not synchronized.
In java, a thread which is in dead state can’t be started again.
We can use the concept of cloning to create copy of an object.
An infinite loop runs without any condition and runs infinitely.
An Iterator can be used to traverse the Set and List collections.
Using clone, we create copies with the actual state of an object.
Multi threading is used to run multiple tasks in a single program.
A static method belongs to the class rather than object of a class.
A class can be made singleton by making its constructor private.
A class can have multiple constructors with different parameters.
An array groups data of same primitive type and is static in nature.
In java, each object when created gets a memory space from a heap.
Searching an element is faster in ArrayList compared to LinkedList.
Vectors are dynamic in nature and can hold data of different data types.
Applets are used for creating dynamic and interactive web applications.
A layout manager is the used to organize the components in a container.
Arrays are static and once we have specified its size, we can’t change it.
Map is an object that maps keys to values and cannot contain duplicate keys.
Static methods can be called directly without creating the instance of the class.
Runnable interface is used in java for implementing multi threaded applications.
In Java, a class can be derived from only one class and not from multiple classes.
Array can hold fixed number of elements while ArrayList can grow dynamically.
Constructor is called automatically when we create an object using new keyword.
run() is a method of Runnable interface that must be implemented by all threads.
In java, main method must be public static in order to run any application correctly.
Arrays can contain primitive or objects, while an ArrayList can contain only objects.
In a switch statement, default case is executed when no other switch condition matches.
For automatic garbage collection java calls either System.gc() method or Runtime.gc() method.
When a string is created in java, it’s actually an object of Java.Lang.String class that gets created.
If an exception is not handled in a program using try catch blocks, program gets aborted suddenly.
finalize() is a method that gets called on an instance of an Object when it is garbage collected.
Looping is used in programming to execute a statement or a block of statement repeatedly.
Java provides a default no argument constructor if no explicit constructor is defined in a Java class.
Break is used after each case (except the last one) in a switch so that code breaks after the valid case.
In java, main() method can’t return any data and hence, it’s always declared with a void return type.
Deadlock describes a situation where two or more threads are blocked forever, waiting for each other.
A singleton class in java can have only one instance. All its methods and variables belong to just one instance.
A java applet is program that can be included in a HTML page and be executed in a java enabled client browser.
Once an object has been destroyed by garbage collector, it no longer exists on the heap and it can’t be accessed again.
In java, when an object is not referenced any more, garbage collection takes place and the object is destroyed automatically.
In Java, Java.lang.Throwable is the super class of all exception classes and all exception classes are derived from this base class.
In Java, access specifiers are the keywords used before a class name which defines the access scope i.e., public, private, protected, default.
In multi-threading, access to the resources which are shared among multiple threads can be controlled by using the concept of synchronization.
Even if no explicit constructor is defined in a java class, objects get created successfully as a default constructor is implicitly used for object creation.
Java Servlet is server side technologies to extend the capability of web servers by providing support for dynamic response and data persistence.
In Java, if we define a new class inside a particular block, it’s called a local class. Such a class has local scope and isn’t usable outside the block where its defined.
When an object is destroyed by a garbage collector, the space allocated to it from the heap is re-allocated to the heap and becomes available for any new objects.
In case of inheritance, when a new object of a derived class is created, first the constructor of the super class is invoked and then the constructor of the derived class is invoked.
Using synchronized keyword, we can ensure that only one thread can use shared resource at a time and others can get control of the resource only once it has become free from the other one using it.
SimpleDateFormat is not thread safe. In multithreaded environment we need to manage threads explicit
ContainerEvent is superclass of ContainerEvent, FocusEvent, KeyEvent, MouseEvent and WindowEvent.
Remote method invocationor RMI allows us to invoke a method of java object that executes on another machine.
39. A ComponentEvent is generated when the size, position or visibility of a component is changed
If we use null reference anywhere in code where the value stored in that reference is used then NullPointerException occurs.
To obtain an iterator to the start of the start of the collection we use iterator() method.
reverse() method reverses all characters. It returns the reversed object on which it was called.
print() and println() are defined under the class PrintStream, System.out is the byte stream used by these methods
isNaN() methods returns true if num specified is not a number, otherwise it returns false.
Number is an abstract class containing subclasses Double, Float, Byte, Short, Integer and Long.
Serialization, deserialization and Memory allocation occur automatically by java run time system.
Time slicing is the process to divide the available CPU time to available runnable thread.
Character wrapper defines 5 constants – MAX_RADIX, MIN_RADIX, MAX_VALUE, MIN_VALUE & TYPE
To avoid deadlock situation in Java programming do not execute foreign code while holding a lock
Daemon thread runs in the background and does not prevent JVM from terminating.
update() method can only be used inside session. update() should be used if session does not contian presistent object
SessionFactory is a thread-safe object. Multiple threads can access it simultaneously
URL, URLDecoder and URLConnection all there are used to access information stored in a URL.
writeObject() is used to write an object into invoking stream, it can be input stream or output stream.
ObjectOutput interface extends the DataOutput interface and supports object serialization.
Java patterns is not a valid classification of design patterns. The correct one is J2EE patterns
Standard output variable ‘out’ is defined in System class. out is usually used in print statement i:e System.out.print().
All command Line arguments are passed as a string. We must convert numerical value to their internal forms manually
Only main() method can be given parameters via using command line arguments
Launch configuration stores the startup class, program arguments and vm arguments
Breakpoints are inserted in code. We can move from one point to another in the execution of program
Debug mode allows us to run program interactively while watching source code and variables during execution
getBytes() stores the character in an array of bytes. It uses default character to byte conversions provided by platform
Whenever a subclass needs to refer to its immediate superclass, it can do so by use of the keyword super.
Declaring a class final implicitly declares all of its methods final, and makes the class inheritable
If a static method is present in the program then it will be executed first, then main will be executed.
If [] is declared after variable it is applicable only to one variable. If [] is declared before variable it is applicable to all the variables.
In java 8,we are asked to migrate to java.time (JSR-310) which is a core part of the JDK which replaces joda library project
Facade pattern hides the complexities of the system and provides an interface to the client using which client can access the system.
JRE is the implementation of JVM, it provides platform to execute java programs.
In java, we can pass argument to a function only by value and not by reference.
this keyword can be used inside any method to refer to the current object
A constructor can call the another constructor of same class using this keyword.
Wrapper classes converts the java primitives into the reference types (objects).
wait() always causes the current thread to go into the object’s wait pool. Hence, using this in a thread will keep it in running state.
Generics gives the flexibility to strongly typecast collections. Generics is applicable to Set, List and Tree. It is not applicable to Array








other avilable courses


codenody