shirmung/OOP — comment on commit 380831f8c9c0824488f2b18083ed87e544ba286f
File:  line 0
By dave-filion:

Here's my idea for printing... just gonna add this to java_lang. It works,
btw:

#include
#include
#include

#include "java_lang.h"

using namespace java::lang;

struct __System;
struct __OutStream;

typedef __System System;
typedef __OutStream OutStream;

struct __OutStream {

static void print(String s) {
std::cout << s;
}

static void println(String s) {
std::cout << s << std::endl;
}

static void print(int i) {
std::cout << i;
}

static void println(int i) {
std::cout << i << std::endl;
}

static void print(double d) {
std::cout << d;
}

static void println(double d) {
std::cout << d << std::endl;
}

static void print(float f) {
std::cout << f;
}

static void println(float f) {
std::cout << f << std::endl;
}

static void print(Object o) {
std::cout << o -> __vptr -> toString(o);
}

static void println(Object o) {
std::cout << o -> __vptr -> toString(o) << std::endl;
}

};

struct __System {
//out object
static OutStream out;
};

int main() {
String s = __rt::literal("Dave");
System::out.print( s );
System::out.println( s );
System::out.println( __rt::literal("Hello World") );
System::out.println( 42 );
System::out.println( 22.4 );
System::out.println( new __Object() );
}

On Thu, Nov 24, 2011 at 8:05 PM, howardjing <
reply@reply.github.com
> wrote:

> this is what happens when i dont have math hoemwork
>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/shirmung/OOP/commit/380831f8c9c0824488f2b18083ed87e544ba286f#commitcomment-745247
>