Just Do Study - IGNOU Assignments Site

Saturday, 6 October 2012

Java Tutorials: Finalize and Garbage Collector Example

class TT extends Object
{
 TT()
 {
 System.out.println("TT Class Default Constructor ");
 }
 protected void finalize()
 {
 System.out.println("TT Object Going to Dead....");
 }
}
 public class SystemClassDemo3 {
 public static void main(String args[])
 {
 TT obj = new TT(); // Strong Reference
 System.gc();
 System.out.println("Now I am Going to Null the Obj ");
 obj = null;
 System.gc();
 System.runFinalization();
 }
}

Java Tutorials: Eclipse Juno Download Link

How To Study: Motivating Yourself To Study

Friday, 5 October 2012

Java Tutorials: Example of Co-variant return type


package project1;
class Fuel
{
int power;
int smoothness;
int roots;
}

class Hydrogon extends Fuel
{
int gasUnit;
}

class Car
{
Fuel run()
{
return new Fuel();
}
}

class FutureCar extends Car
{
Hydrogon run()
{
return new Hydrogon();
}
}

public class Class4
{
public Class4()
{
}

public static void main(String[] args)
{
FutureCar futureCar = new FutureCar();
futureCar.run();
}
}

Java Tutorials: Eclipse Shortcuts


File Navigation – Eclipse Shortcuts

CTRL SHIFT R – Open a resource. You need not know the path and just
part of the file name is enough.

CTRL E – Open a file (editor) from within the list of all open files.

CTRL PAGE UP or PAGE DOWN – Navigate to previous or next file from
within the list of all open files.

ALT <- or ALT -> – Go to previous or next edit positions from editor
history list.

Java Editing – Eclipse Shortcuts

CTRL SPACE – Type assist

CTRL SHIFT F – Format code.

CTRL O – List all methods of the class and again CTRL O lists
including inherited methods.

CTRL SHIFT O – Organize imports.

CTRL SHIFT U – Find reference in file.

CTRL / – Comment a line.

F3 – Go to the declaration of the variable.

F4 – Show type hierarchy of on a class.

CTRL T – Show inheritance tree of current token.

SHIFT F2 – Show Javadoc for current element.

ALT SHIFT Z – Enclose block in try-catch.