KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > j2biz > pencil > test > scenario > impl > TypeCheck


1 /*
2  * Copyright 2004 Andreas Siebert (j2biz community)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7
8  * http://www.apache.org/licenses/LICENSE-2.0
9
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.j2biz.pencil.test.scenario.impl;
17
18 import com.j2biz.pencil.test.additional.TestLog;
19 import com.j2biz.pencil.test.stuff.Person;
20
21 public class TypeCheck {
22
23     
24         public static void main(String JavaDoc[] args) {
25             String JavaDoc varStr = new String JavaDoc("string variable");
26             TestLog.debug( "TypeCheck.main.varStr = "+ varStr);
27             
28             int varInt = new Integer JavaDoc(1).intValue();
29             TestLog.debug( "TypeCheck.main.varInt = " + varInt );
30             
31             short varShort = new Short JavaDoc((short)1).shortValue();
32             TestLog.debug( "TypeCheck.main.varShort = " + varShort );
33             
34             byte varByte = new Byte JavaDoc( (byte) 1).byteValue();
35             TestLog.debug("TypeCheck.main.varByte = " +varByte );
36             
37             char varChar = new Character JavaDoc( 'a' ).charValue();
38             TestLog.debug("TypeCheck.main.varChar = " + varChar );
39             
40             long varLong = new Long JavaDoc(1L).longValue();
41             TestLog.debug("TypeCheck.main.varLong = " +varLong );
42             
43             double varDouble = new Double JavaDoc(1L).doubleValue();
44             TestLog.debug("TypeCheck.main.varDouble = " + varDouble );
45             
46             float varFloat = new Float JavaDoc(1L).floatValue();
47             TestLog.debug("TypeCheck.main.varFloat = " +varFloat );
48             
49             Person person = new Person(1);
50             TestLog.debug("TypeCheck.main.person = " + person);
51         }
52 }
53
Popular Tags