How to use kXML to parse XML files in J2ME projects

kXML is a small XML pull parser, specially designed for constrained environments such as Applets, Personal Java or MIDP devices. The problem for J2ME MIDlets is that there are mobile devices that don’t support the XML API for Java ME additional package (JSR 280). In order to solve this problem, we need an independent and […]

Read More →
How to parse XML, RSS feed with kXML in a J2ME MIDlet

More an more mobile devices are used to access Internet and connected services. One efficient way to transfer data between different platforms and technologies is to use XML files, which are simple text files formatted accordingly to the XML rules. IN order to process an XML file and to extract needed data you need a […]

Read More →
Tutorial Java SCJP – #16 Constructors

In a class you can define methods, but there is a special type of methods which are used to solve a particular problem, to construct objects. Constructor methods are special because of their role and because they have a lot rules regarding declaration and usage.

Read More →
Tutorial Java SCJP – #15 Wrapper classes for primitive types

In Java there are 2 important categories of data types: references and primitives. Most of the time, numeric values, chars and boolean values are used as primitives because it is more efficient as processing speed and memory requirements. Despite that, there are scenarios (like using Collections) when it is needed to store primitive values inside […]

Read More →
Tutorial Java SCJP – #14 Methods and passing variables into methods

In Java, methods define the object behavior or implement different functionalities at class level (for static methods). If variables (value type or references) represent the static part of Java programming,then methods represent the dynamic part because methods are equivalent to code blocks that are executed and that are processing some variables.

Read More →
Tutorial Java SCJP – #13 Packages and Class access modifiers

Two important concept of Object Oriented Programming is to separate entities based on their functionality or logic and to hide data and behavior within a class (encapsulation). For that you have classes used to define entities that have attributes and a behavior (their methods). At a higher level, for a good organization of the application […]

Read More →
How to skip C++ access modifiers – not real code security

C++ is not a pure object oriented programming language (this topic is just another argument) but it is implementing OOP concepts. On of these concepts is encapsulation: the object hides its contents (attributes or instance variables) by making them private / protected and gives access to them through public methods (like getters and setters).

Read More →
Tutorial Java SCJP – #12 Immutable, String and Integer

Immutable objects are objects that don’t change their value once they are created. The most known immutable object in Java is String. Besides String, there is another immutable object, and this is Integer (the class and not the primitive) which has an interesting behavior for values between -128 and 127 .

Read More →
Tutorial Java SCJP – #10 Variable Scope

Many compiler errors are generated because programmers don’t have a clear image on how long variables are available and when they can access them. The variable scope concept  describes the life of a variable, or its availability area, after it was defined.

Read More →
Tutorial Java – #9 Garbage collection and memory leaks

Since the first days of computer programs, one important performance issue was the and still is the amount of used memory. Despite the fact that today the hardware technology provide large amounts of Random Access Memory, software developers must pay attention to how they manage the application memory because they can implement wrong solutions that […]

Read More →
Tutorial Java – #8 Understand Stack and Heap

In order to have a deep understanding of the Object Oriented Programming in Java or any other OOP language (like C#) you must know how things are managed internally by the Java process and by the JVM. Of course Java syntax and Java implementations of OOP principles are important but you will have a more […]

Read More →
Tutorial Java – #7 Reference data type variables

In this post it is described one of the most important concepts of Object Oriented Programming: Every class instance, object, is managed only by reference type variables (for those who know also C++, you could remember that in C++ this rule is not entirely true because objects are also managed by value type variables). This […]

Read More →
Tutorial Java – #6 Classes and objects

Classes represent the basic principles of object-oriented programming. Classes are abstract concepts, stories, blueprints, describing: characteristics, attributes of an object; these represent what the object knows, what it is; object methods; these represent what the object knows to do, its behavior; Based on classes, the programmer can define something concrete, objects. Thus, by instantiating the […]

Read More →
Tutorial Java 6 – #5 Flow control statements

In this post we can see how to implement in Java, the basic flow control structures / statements: decision-making structures: if – then, if – then – else, switch; structures for loop blocks: do-while, while – do, enhanced – for; loop control instructions: break, continue; Using control structures we can write programs for which the […]

Read More →
Tutorial Java 6 – #4.3 Matrixes and Multidimensional Arrays

In this post we will see what are and how to define multidimensional arrays. The most common multidimensional array is the matrix – a two dimension array. Despite the fact in our mind a two-dimension array is like a table, a matrix is in Java an array of arrays, like in this image (a two-dimension […]

Read More →