How To Add In Println

Oct 10, 2014

class first
{
public static void main(String []args)
{
System.out.println(args[0]+" "+args[1]+" "+args[3]+" "+args[4]);
int dec = 267;
int hex = 0x10B;
int oct = 0413;
int bin = 0b100001011;
System.out.println("Octal + Binary : "+oct+bin);
System.out.println("HexaDecimal + Decimal : "+dec+hex);
}
}

i want add two variables in print method.... how should i use the concatenate operator for the same.

View Replies


ADVERTISEMENT

Println Of Variables - Not Getting Right Outputs

May 15, 2014

I'm making an armor class. I also made a test for it to ensure it works, but something seems to be wrong. I'm not getting the expect outputs when I ask it to give me a println of the variables.

This is the armor class:

import java.util.Random;
public class Armor
{
//fields
CharacterRace charRace;
String armorName;
public int cost;
public int armorBonus;
public int armorCheckPenalty;
public int arcaneSpellFailChance;

[Code] ....

And this is the CharacterRace class enum:

public enum CharacterRace
{
HUMAN, ELF, HALFELF, HALFORC, DWARVE, GNOME, HALFLING
}//end enum

And lastly, this is what the armor test prints out:

0
0
0
true
true
true

I never get false (I should sometimes) and those 0s should be

30
30
15

What's wrong with my code?

View Replies View Related

Servlets :: HTML Not Printing If Change Location Of Println Statement?

Mar 2, 2015

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.ServletException;

[Code] ....

When I run the above code , the html is not printed ?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved