1. println()పద్ధతి యొక్క పారామితులు

మెథడ్ బాడీ ఆదేశాలను కలిగి ఉంటుంది . మీరు ఒక పద్ధతి అనేది ఒక పేరు ఇవ్వబడిన ఆదేశాల సమూహం అని కూడా చెప్పవచ్చు , అంటే పద్ధతి పేరు. దృక్పథం ఏదైనా ఖచ్చితమైనది.

వివిధ రకాల ఆదేశాలు ఉన్నాయి. జావా భాషకు ప్రతి సందర్భానికి ఒక ఆదేశం ఉంటుంది. ప్రతి ఆదేశం కొన్ని నిర్దిష్ట చర్యను నిర్వచిస్తుంది. ప్రతి కమాండ్ చివరిలో సెమికోలన్ వెళుతుంది .

ఆదేశాల ఉదాహరణలు:

ఆదేశం వివరణ (ఇది ఏమి చేస్తుంది)
System.out.println(1);
స్క్రీన్‌పై సంఖ్యను ప్రదర్శిస్తుంది:
1
System.out.println("Amigo");
స్క్రీన్‌పై వచనాన్ని ప్రదర్శిస్తుంది:
Amigo
System.out.println("Risha & Amigo");
స్క్రీన్‌పై వచనాన్ని ప్రదర్శిస్తుంది:
Risha & Amigo

వాస్తవానికి, ఇది కేవలం ఒక ఆదేశం - System.out.println. దానికి ఆమోదించబడిన వాదనలు కుండలీకరణాల్లో ఉన్నాయి . పారామితుల విలువపై ఆధారపడి, ఆదేశం వివిధ చర్యలను చేయగలదు. ఇది చాలా సౌకర్యవంతంగా ఉంటుంది.

ముఖ్యమైన:

జావాలో, ఒక పద్ధతిలోని అక్షరాలు పెద్ద అక్షరం లేదా చిన్న అక్షరం అనే విషయంలో పరిమాణం ముఖ్యం . ఆదేశం పని చేస్తుందిSystem.out.println() , కానీ పని చేయదు .system.out.println()

మీరు వచనాన్ని ప్రదర్శించాలనుకుంటే, మీరు దానిని రెండు వైపులా డబుల్ కోట్‌లతో గుర్తు పెట్టాలి .

ఒకే కోట్ ఇలా ఉంటుంది 'మరియు డబుల్ కోట్ ఇలా కనిపిస్తుంది ". డబుల్ కోట్ అనేది రెండు సింగిల్ కోట్‌లు కాదు: దయచేసి దానితో గందరగోళం చెందకండి.

డబుల్ కోట్స్ చిహ్నం ఎంటర్ కీ పక్కన ఉంటుంది .


println()2. మరియు మధ్య వ్యత్యాసాలుprint()

స్క్రీన్ అవుట్‌పుట్ కోసం కమాండ్ యొక్క రెండు వైవిధ్యాలు ఉన్నాయి: మరియుSystem.out.println()System.out.print()

మీరు ఆదేశాన్ని చాలాసార్లు వ్రాస్తే , ప్రతిసారీ పాస్ చేసిన టెక్స్ట్ కొత్త లైన్‌లో ప్రదర్శించబడుతుంది . మీరు ఉపయోగిస్తే , టెక్స్ట్ అదే లైన్‌లో ప్రదర్శించబడుతుంది . ఉదాహరణ:System.out.println()System.out.print()

ఆదేశాలు ఏమి ప్రదర్శించబడుతుంది
System.out.println("Amigo");
System.out.println("IsThe");
System.out.println("Best");
Amigo
IsThe
Best
System.out.print("Amigo");
System.out.println("IsThe");
System.out.print("Best");
AmigoIsThe
Best
System.out.print("Amigo");
System.out.print("IsThe");
System.out.print("Best");
AmigoIsTheBest

ఒక చిన్న గమనిక. ఆదేశం println()కొత్త లైన్‌లో వచనాన్ని ప్రదర్శించదు. బదులుగా, ఇది ప్రస్తుత లైన్‌లో వచనాన్ని ప్రదర్శిస్తుంది - ప్రదర్శించబడే తదుపరి టెక్స్ట్ కొత్త లైన్‌లో కనిపిస్తుంది.

కమాండ్ println()టెక్స్ట్‌ని ప్రదర్శిస్తుంది మరియు ప్రత్యేక అదృశ్య న్యూలైన్ అక్షరాన్ని జోడిస్తుంది. ఫలితంగా, తదుపరి వచనం కొత్త లైన్ ప్రారంభంలో ప్రదర్శించబడుతుంది .

Amigoక్లాస్ మరియు పద్ధతి యొక్క డిక్లరేషన్‌తో పాటు పూర్తిగా వ్రాసిన ప్రోగ్రామ్ ఇలా ఉంటుంది main. మీ కళ్ళను స్క్రీన్‌పై ఉంచండి:

public class Amigo
{
   public static void main (String[] args)
   {
      System.out.print("Amigo ");
      System.out.print("The ");
      System.out.print("Best");
   }
}
Amigoతరగతి మరియు mainపద్ధతి యొక్క ప్రకటనతో ప్రోగ్రామ్

2
టాస్క్
Java Syntax,  స్థాయిపాఠం
లాక్ చేయబడింది
Contract
The rule "Always read the terms of the contract!" seems simple enough, but so many people get burned because they don't follow it! But programmers are not like that. They always carefully study project conditions/specifications and only then do they draw conclusions, make plans, and start working. Let's practice a useful skill: we'll change the terms of the contract to be more favorable.