Archive for November, 2007


Condition Operator ( ?: )

Thursday, November 29th, 2007

Condition Operator that java provides (?:) can be used in place of an if..else statement. THis is a Java only ternary operator this means it takes three operands.the first witch is before the ? is if the value is true or false – and after the ? is the action to be done IF TRUE and AFTER : is the action to be done if FALSE.so its like this (more…)

OOP-Relationship & Two-dimensional Array

Tuesday, November 27th, 2007

Object Oriented programming inheritance;

Small Note:  System.out.print(className) will go throw the class until he finds a toString() method and prints it out for you.

So you dont need to type : System.out.print(className.toString); you just type the name if you only have ONE toString(). Two Dimensional Array:

(more…)

Converting & more

Sunday, November 25th, 2007

I’m going to write some of my notes on Converting Java Strings/Chars/…etc  to Int/Char/String…  This is a short list of notes that may help me & I Hope you in the future.

(more…)

Printing out Char writeChar

Tuesday, November 6th, 2007

If you want to make a method that writes your “char(s)” all out, you cannot do it like you do with toString() method, because char is different. You have to create the System.out.println inside the method it self. You can also call for a return of this char array and use it later.

(more…)

Constructor ( With/Without ) Parameter & Method

Tuesday, November 6th, 2007

What is a method?

A Method provides information about, and access to, a single method on a class or interface. The reflected method may be a class method or an instance method (including an abstract method).

Method example : getName(); // This will return the name value.so getName have to be getName() { return name; }
They cannot be declared in a public static void main(String[] args) ! but outside.
You have to create them in a public class { } call them from another class or same:)

(more…)

Making “connection” between classes

Tuesday, November 6th, 2007

Let say you have two classes and you want to connect them. First make two classes to connect. You actually make a new object and control it.

(more…)

public static methods !

Tuesday, November 6th, 2007

Static methods is used so it cud be used from other classes without making a new object out of the class it self. So let say you have a static vale of 10, and you want to share it with the other class, you simply call the class name and then the method that returns its value, like this: className.methodName();

now this task is done with two classes, it will generate random arrays that holds 12 arrays, and will put in randomized order {u,h,b) shortcut in norwegian as uavgjort, borte, hjem.

(more…)

For Loop

Tuesday, November 6th, 2007

For loop, goes threw your “Object(s), Array(s)…etc” it can gather information and add information where the “loop” is at…

(more…)

System in, Simple programming

Monday, November 5th, 2007

Notes from simple programming, How to enter a user input and change use it as String/int/Char…

(more…)

Java

Monday, November 5th, 2007

Im going to start writing some notes about java programming in school. I figure this would maybe help me out in the future.

But for now I just want to start typing in some things I had problems with, and there final answer/solution coding tips.