Jump to content

Recommended Posts

Posted
 

 

6wItAcC.png

 

 

Java Data and Variables

 

There are 8 primitive data types. he 8 primitive data types are numeric types. The names of the eight primitive data types are:

 

byte short int long float double char boolean

There are both integer and floating point primitive types. Integer types have no fractional part; floating point types have a fractional part. On paper, integers have no decimal point, and floating point types do. But in main memory, there are no decimal points: even floating point values are represented with bit patterns. There is a fundamental difference between the method used to represent integers and the method used to represent floating point numbers. 

 

 

7wxrbU8.png

 

 


Examples

 

int yr = 2006;

double rats = 8912 ;

 

         For each primitive type, there is a corresponding wrapper class. A wrapper class can be used to convert a primitive data value into an object, and some type of objects into primitive data. The table shows primitive types and their wrapper classes:

 

 

qtZkbI7.png

 

 

Variables only exist within the structure in which they are defined. For example, if a variable is created within a method, it cannot be accessed outside the method. In addition, a different method can create a variable of the same name which will not conflict with the other variable. A java variable can be thought of as a little box made up of one or more bytes that can hold a value of a particular data type:

 

Syntax: variabletype variablename = data;

 

Source Code ( demonstrating declaration of a variable )



class example
{
  public static void main ( String[] args )
  {
    long x = 123;    //a declaration of a variable named x with a datatype of long


    System.out.println("The variable x has: " + x );
  }
}



Source Code



public class MaxDemo {
     public static void main(String args[]) {
     //integers
          byte largestByte = Byte.MAX_VALUE;
          short largestShort = Short.MAX_VALUE;
          int largestInteger = Integer.MAX_VALUE;
          long largestLong = Long.MAX_VALUE;




         //real numbers
         float largestFloat = Float.MAX_VALUE;
         double largestDouble = Double.MAX_VALUE;



       //other primitive types
        char aChar = 'S';
        boolean aBoolean = true;



        //Display them all.
        System.out.println("largest byte value is " + largestByte + ".");
        System.out.println("largest short value is " + largestShort + ".");
        System.out.println("largest integer value is " + largestInteger + ".");
        System.out.println("largest long value is " + largestLong + ".");
        System.out.println("largest float value is " + largestFloat + ".");
        System.out.println("largest double value is " + largestDouble + ".");
   }
}



 


Sample Run

 

The largest byte value is 127.

The largest short value is 32767.

The largest integer value is 2147483647.

The largest long value is 9223372036854775807.

The largest float value is 3.4028235E38.

The largest double value is 1.7976931348623157E308.

 

 

Dear Baggos mentioned on my previous post that a guide related to variables would be nice so here it is :)

Thanks.

 

Posted (edited)

vampir only said than

if (condition)
{
  _var = 1;
}
else
{
   _var = 2;
}

could be replaced by

if (condition)
   _var = 1;
else
   _var = 2;

and even more sexier by

_var = (condition) ? 1 : 2;
Edited by Tryskell
Posted

 

vampir only said than

if (condition)
{
  _var = 1;
}
else
{
   _var = 2;
}

could be replaced by

if (condition)
   _var = 1;
else
   _var = 2;

and even more sexier by

_var = (condition) ? 1 : 2;

 

I like the way you think XD

Posted (edited)

I like the way you think XD

 

See a real case scenario of "if/else if" shortcuted here (fighter / mage buffs) : 

 

http://www.maxcheaters.com/topic/211475-newbies-helper-npc-acis/?p=2611476

 

As you can see, that idiom

(check) ? trueStatement : falseStatement

 can reduce redundant code for the same output.

Edited by Tryskell
Posted (edited)

See a real case scenario of "if/else if" shortcuted here (fighter / mage buffs) : 

 

http://www.maxcheaters.com/topic/211475-newbies-helper-npc-acis/?p=2611476

 

As you can see, that idiom

(check) ? trueStatement : falseStatement

 can reduce redundant code for the same output.

 

Yea i have alot to improve thanks for showing me the way :) thats a way to shorten the code also make the code easier to read and understand.

Edited by Sawadee
Posted

http://www.freejavaguide.com/java_variables.htm

 

Im dying laughing over here.

 

Nice u diged internet to find what i shared, but i didnt even know that this guide was posted on somewhere as i mentioned before i just copy and paste this guide from a pdf file that i found in my pc thats simple theres no need to tryhard :) The difference between me and you, you just break balls and do actually nothing for this community and i try to help with anythin/whatever i have/can.

Posted

Nice u diged internet to find what i shared, but i didnt even know that this guide was posted on somewhere as i mentioned before i just copy and paste this guide from a pdf file that i found in my pc thats simple theres no need to tryhard :) The difference between me and you, you just break balls and do actually nothing for this community and i try to help with anythin/whatever i have/can.

Exquse me but you just got pwned. http://www.maxcheaters.com/topic/203773-free-help-small-code-fixes-request-small-codes/

Also continue this "speech". Next time you're reported for share guides without credits and bad language toward members. 

Posted (edited)

Exquse me but you just got pwned. http://www.maxcheaters.com/topic/203773-free-help-small-code-fixes-request-small-codes/

Also continue this "speech". Next time you're reported for share guides without credits and bad language toward members. 

 

Bad language toward members? u should be banned for trolling and spammin on other people guides all the time i already reported you 3 times and im goin to do it again lets see who will be banned. stop acting like a lawyer u are just a simple member here mind your own business if anything is wrong with me ill be punished if anything is wrong with you, you will be punished just for gods sake stop posting on other topics and judge the people like your are their boss.

Edited by Sawadee
Posted

Bad language toward members? u should be banned for trolling and spammin on other people guides all the time i already reported you 3 times and im goin to do it again lets see who will be banned. stop acting like a lawyer u are just a simple member here mind your own business if anything is wrong with me ill be punished if anything is wrong with you, you will be punished just for gods sake stop posting on other topics and judge the people like your are their boss.

You can't report someone who just tell you that you sharing tutorials without adding credits and going against rules. What you gonna report me for? 

"This user flame my topic and force me to put credits on stolen tutorials?" 

 

I don't flame, i just say you go against rules and leech other's tutorials. You dont want understand it? Report me as many times you want but read rules and we see who is wrong and who is right.

Posted

You can't report someone who just tell you that you sharing tutorials without adding credits and going against rules. What you gonna report me for? 

"This user flame my topic and force me to put credits on stolen tutorials?" 

 

I don't flame, i just say you go against rules and leech other's tutorials. You dont want understand it? Report me as many times you want but read rules and we see who is wrong and who is right.

 

I didnt even read anything ill be honest, lets see what will be the action of admin/moderators about us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • New release   World & atmosphere   - Grass is back — terrain grass now grows across the world like the original client, with settings for on / original-style / off, two sway styles, and optional grass shadows.   - Day/night and the sky now follow the game server, including sunrise, sunset, Seven Signs skies, and red-sky events. A manual override remains available in settings.   - Doors are now live — castle and town doors open and close according to the server, can be targeted, and display their health.   - Earthquake events now shake the screen and play their original rumble sounds.    Map & navigation   - New live minimap — an always-on radar with a rotating player arrow, party, target and NPC markers, zone labels, hover tooltips, three zoom levels, and collapse and resize controls. Clicking it opens the full world map.   - Zone titles now fade onto the screen when you enter a new region.   - The world map now displays your current zone name and party-member positions.   Combat & effects   - Enchanted weapons now glow properly, complete with drifting wisps, across every weapon type — including on the character selection screen.   - Soulshot, Spiritshot, Fishing Shot, and Beast Shot activations now play their original flashes and sounds. A new “hide shot effects” option is available if you prefer not to see them.   - Item-use visuals have been restored — potions, antidotes, echo crystals, fireworks, and other usable items now play their proper effects.   - Skill damage now displays floating damage numbers, and critical skill hits shake the camera.   - New buff bar — active buffs, debuffs, and toggles now appear as icons above the HUD.   - Bow skills now nock and release their arrows at the correct animation moments.   Shops & items   - NPC shops now work — a complete buy window with prices, weight and Adena totals, stock limits, and a quantity dialog for stackable items.   - Player-to-player trading now works, including timed trade requests, complete inventory and offer panes, quantity selection for stackable items, weight preview, confirmation locking, cancellation, and trade completion.   - Item enchanting now works — using an enchant scroll opens the original-style item selection window with enchant levels and full item tooltips, plus proper selection and cancellation handling.   - Item cooldowns, including potions and similar items, now appear on the shortcut bar.   - Item tooltips and the inventory window have received further polish.   - Weapon tooltips now correctly identify weapon classes and calculate enchant-adjusted P. Atk. values for bows, two-handed weapons, fists, and dual swords.   Chat & commands   - Slash commands now work, including /time, /loc, and other server commands. GM accounts can also use // admin commands.   - Action commands can now be entered directly in chat, including sit/stand, walk/run, normal and forced attacks, trade, target next, pickup, assist, party actions, social emotes, and duels.   - System messages can optionally be separated into their own window, and the chat font size is adjustable.   - Server event announcements now appear on screen as they did in the original client.   Interface   - A live animated portrait of your character now appears beside the HP and MP bars.   - The client now ships with its own Tahoma and Noto Sans fonts, allowing text to work across languages. Chat and nameplate fonts can be selected in the new Fonts settings section.   - The target window has been refined — clicking the level chip now expands or collapses the window.   - NPC dialog windows have received additional polish, including proper window titles and button labels. Download from the launcher you have installed or at https://updates.fermata.gg/ if you don't have the launcher
    • Damn there are still people that value Lineage! Great job Elfo as always!
    • Payment Methods Credit/Debit Card, PayPal, Wise, Payoneer, Binance Pay, Bybit, Crypto, and other supported payment options depending on availability. Delivery Time / TAT General delivery time: Instants to 24 hours Depended on Products. Some products may take longer depending on stock, account eligibility, product type, payment confirmation, or activation requirements. Refund & Replacement Policy If we cannot deliver the product within the confirmed delivery time and you do not want to wait, you are eligible for a refund. If the account, gift link, gift code, or activation does not work at first login/activation, please contact us within 24 hours with screen recording proof before start purchasing. If the product is successfully delivered and activated, refund is not available unless a specific warranty was mentioned for that product. Warranty period depends on the product type. Some products may include replacement support for a limited period. Please ask before ordering if warranty is important. No refund/replacement is available if the buyer shares account details, changes recovery/security settings without asking, uses VPN/proxy in a risky way, violates platform rules, fails to provide proof, or changes their mind after successful use. If a platform changes its policy, eligibility, country availability, or subscription system after delivery, we will try to help, but we cannot control third-party platform changes. Important Notes Stock may be limited for some products at klouditem. Prices may change depending on market, stock, and product availability. Some services may require your personal email/account for upgrade. Some services are ready-made accounts only. Some products may have country or account eligibility requirements. Please read the product details before ordering. We do not claim to be an official partner of any platform unless clearly stated by the platform itself. Product names and logos belong to their respective owners. Review Copies Review copies are not always available. If we open a review copy round, we will announce it in this thread and select qualified members based on account history, activity, and availability. Please do not request review copies unless we have announced them. FAQ Q: Do you deliver instantly? A: Delivery is usually Instant to 24 hours, depending on stock and payment confirmation. Q: Can I upgrade my own account? A: Some services support own account upgrade, while others are ready-made account only. Please ask before ordering. Q: Do you provide support after delivery? A: Yes, we provide support for login, activation, and basic setup issues related to the delivered product. Q: Can I check stock before payment? A: Yes, please ask before payment. We will confirm stock and delivery time first. Q: Are prices fixed? A: Some prices are fixed, and some depend on stock/package. Q: What should I do if I face an issue? A: Contact us as soon as possible with clear screenshot or screen recording proof from purchase, and we will check it.   Contact Buy Now: https://klouditem.com Telegram Support: https://t.me/Klouditem
    • https://prnt.sc/MCxO-vS1MHuA how to zoom in? and on every click ad popup.. nonsense.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..