الأربعاء، 3 يوليو 2013

Oracle Certifited Associate Java programmer (OCAJP 7) Free Mock Exams

Here are some real Exam Questions for OCAJP 7

What will the following code print when compiled and run?

class ABCD{
   int x = 10;
   static int y = 20;
}
class MNOP extends ABCD{
   int x = 30;
   static int y = 40;
}

public class TestClass {
   public static void main(String[] args) {
     System.out.println(new MNOP().x+", "+new MNOP().y);
   }
}
 
  • 10,40
    30,20
    10,20
    30,40
    20,30
    compilation error 
    
    
    -----------------------------------------------------------------------
    
    
    Which of these array declarations and instantiations are legal?
    
      
        int[ ] a[ ] = new int [5][4] ;
        int a[ ][ ] = new int [5][4] ;
        int a[ ][ ] = new int [ ][4] ;  
        int[ ] a[ ] = new int[4][ ] ;
        int[ ][ ] a = new int[5][4] ;
      
    
    
    
    
 

السبت، 22 يونيو 2013

How to create rotated Text using birt api

Today i will introduce you how to create rotated Text using birt api

1 - download this JARs
from http://code.google.com/a/eclipselabs.org/p/birt-controls-lib/?redir=1
2 - add these jars into the "java build path"
3 - use the ExtendedItemHandle class as follow

{code}

                ExtendedItemHandle es=designFactory.newExtendedItem("ex1", "RotatedText");
                es.setProperty("rotationAngle", "90");
                es.setProperty("text", "\"HELLO\"");
                es.setProperty("wrapPoint", "0in");
                
{code}

4 - add the es object to any container that you want to have the rotated text


{code}
     LabelHandle label1s = designFactory.newLabel( "MultiLineHeader");
                    label1s.setText("Multi Line Header");
                    CellHandle cell1 = (CellHandle) tableheader0.getCells( ).get(0);
                    tableheader0.getCells( ).get(1).drop();
                    tableheader0.getCells( ).get(2).drop();
                    cell1.setColumnSpan(3);
                  
                    cell1.getContent( ).add( es );

{code}

My First Java Topic

My First Java Topic
Hello Java Fans
This is My Java blog,I will try to share my java knowledge with you
hope everyone doing well
thanks