Hi all,

i'm fooling around with Inline::Java

I wrote this:

public class Karl { private static String nose( String is){ return is; } public static void main(String[] args) { System.out.println(nose ("inferior")); // System.out.println(nose (1)); + } }

And i get:

karls-mac-mini:java karl$ java Karl inferior

This works as expected.

Now with System.out.println(nose (1));

I guess this works as expected as well:

karls-mac-mini:java karl$ javac Karl.java Karl.java:7: error: incompatible types: int cannot be converted to Str +ing System.out.println(nose (1)); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbo +se to get full output 1 error

The same thing with Inline::Java:

// ./lib/java/Karl.java + class Karl { private Karl(){ } public static String nose( String is){ return is; } }

 

#!/usr/bin/env perl + use strict; use warnings; use Inline Java => q(./lib/java/Karl.java); use feature qw(say); my $is = q(inferior); say Karl->nose($is); say Karl->nose(1); __END__

Now i get this:

karls-mac-mini:java karl$ ./java.pl inferior 1

How can i capture this?

I must admit that i'm stuck for the moment.

Thank you very much for any hint, Karl

Edit: Fixed wrong links

«The Crux of the Biscuit is the Apostrophe»


In reply to About Java::Inline [SOLVED] by karlgoethebier

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.