sábado, 22 de outubro de 2011

How to Install CentOS 6 in a VMware Workstation 8



This first post takes us to install the CentOS linux distriubuição 6 (Community Enterprise Operating System). This distribution is regarded as one of the most stable in the world of Linux servers.


Step 1: Download CentOS ISO's.


Acess CentOS download center and chose your distribution


I choosed download the 64 bits version, but you can choose whatever it fits better for you.




Step 2:VMware workstation


I'll assume you already have it installed.
If don't have it already and have any doubt's on installing check this .


Step 3: Installation


Open your VMware console and select "Create a New Virtual Machine"


VMware Workstation
For this tutorial i will choose "Typical" instalation.

Wizard - Type of installation
Choose to install from image file, and browse to your CentOS 6 iso.


Wizard - Choose installer method
Now its time to give a name to our machine and set user and root password.


Wizard - Machine Personalization

Choose a name and a locationfor your vistual machine


Wizard - Machine name and location 
Select the size you will give to your new virtual machine

Wizard - Machine size
It will be given to you a summary of the machine to be created, review it and if you are happy with the settings press "finish"!



Wizard - Summary
Go out take a coffe and you should get something like this on your VMWare console.



sexta-feira, 21 de outubro de 2011

JAVA - Class Modifiers


You have three class modifiers in JAVA:




strictfp

Can only be used in classes and methods.

If mark a class as strictfp you are saying that any method in the class will folow the IEEE 754 standard rules for floating points.


final
Marking the class with this keyword you are proibing the class to be subclassed.In pratice no one will be able to extend it.Why would you mark a class as final ?Sometimes you want things to be done "your way on no way" :)
Lets see what hapens when you try extend a class marked as final...
Declaring...

package cert;
public final class Beverage {
public void importantMethod() { }
}

Extending...

package exam.stuff;
import cert.Beverage;
class Tea extends Beverage { }
Compiling...

Can't subclass final classes: class
cert.Beverage class Tea extends Beverage{
1 error

abstract
An abstract class cannot be instantiated.Its created you the purpose of being extended.Imagine class Vehicle there is no point in the creation of a instance of vehicle, but it makes a lot of sense in create a Car instance class that extends Vehicle providing Car with all common methods all vehicle have.

What no to do... :)

Creating a abstract Class
abstract class Car {
private double price;
private String model;
private String year;
public abstract void goFast();
public abstract void goUpHill();
public abstract void impressNeighbors();
// Additional, important, and serious code goes here
}
Trying to instantiate it...

AnotherClass.java:7: class Car is an abstract
class. It can't be instantiated.
Car x = new Car();
1 error

TO RETAIN:
  • You can modify class declarations and use any of these modifiers in conjunction with any access control (public , default).
  • You can't always mix these nonacces modifiers! You can't and there is no sense in making a class with final and abstract (i will talk about this later...but its like saying "This class can't and must be extended" it doen't make a lot of sense right ?:) )
  • Abstract classes may have implemented methods, there are some methods you might consider give a "default" implementation, and so giving to the subclasses a common implementation.
  • If a method is declared abstract you got to set the class as abstract
Code retrived from here

Checkout this sites:


JAVA - Classes Access

Default
  • A class with default access as no modifier in its declaration
package certification;
class Beverage { }
  • Default access is package-level access, because a class with default access can be seen only by classes within the same package.This means if you try something like this:
package exam.stuff;
import cert.Beverage;
class Tea extends Beverage { }
     You'll get ....
    Can't access class cert.Beverage. Class or interface must be
    public, in same package, or an accessible member class.
    import cert.Beverage;


    Public
    • A class with public access uses the public keyword.

    package certification;
    public class Beverage { }
    • Public access means that all classes can access and create subclasses based on public class.You still have to import the package but this time you want get that nasty error..
    Private
    • This can only be declared for inner classes, making the class private and only visible to the top level class where it is defined.
    Code retrived from here.

    quarta-feira, 19 de outubro de 2011

    terça-feira, 18 de outubro de 2011

    Hello World!

    Hi all!


    This is my "Hello world" script in the blog way!
    Here you'll be able to see my experiments in IT and development areas.
    Hope you'll enjoy to read as mutch i hope to enjoy writing it!:)


    I plan to start posting firstly about systems (if you want to play with technology, first you got to have your playground ;) ) and some "stiky notes" in my way to "Sun Certified Programmer for Java 6" certification, after that i plan to have no plans, lets go with the flow...


    Best Regards,
    Luís