answersLogoWhite

0

A String in Java is an object, just like an Integer, which means creating them calls their class file, which has to be capitalized. Variables like int and float are primitive variables, meaning an object isn't created to hold them, so they aren't capitalized.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write string 'dhairya' into 'ayriahd' in c?

printf ("%s -> %s\n", "dhairya", "ayriahd");


Given a String variable s how do you write a code segment that outputs each letter in the string twice?

void printChars(final String s) { for(char ch:s.toCharArray()) { System.out.print(ch); System.out.print(ch); } }


Write a program to generate uppercase using cSharp?

string s = "asdfqwer"; s = s.ToUpper(System.Globalization.CultureInfo.CurrentCulture);


Using Python write an algorithm that takes a string as input and determines whether or not it is a palindrome?

def isPalindrome(s): return s == s[::-1] then just call the function with a string like isPalindrome('poop')


How would you write this in Python Assume that word is a string for example slice Write a code to print out the following pattern s sl sli slic slice?

>>> string = 'slice' >>> letters = list(string) >>> print letters ['s', 'l', 'i', 'c', 'e'] >>> string2 = '' >>> for letter in letters: string2 += letter print string2 s sl sli slic slice


How do you write method pubic boolean containsString s Return whether the given string is in the array or not?

Return an iterator to the string if it exists, or the container's end iterator if it does not.


Write a program that converts a string from small letters to capital letters and vice versa?

Here's a Python program that accomplishes this: def convert_case(input_str): return input_str.swapcase() user_input = input("Enter a string: ") converted_str = convert_case(user_input) print("Converted string:", converted_str)


Write a Java program to generate a copy of itself?

public class S{public static void main(String[]a){String o="public class S{public static void main(String[]a){String o=%c%s%c;System.out.printf(o,34,o,34);}}";System.out.printf(o,34,o,34);}}


How do you write tetra atomic sulfur?

S4 , capital 'S' plus subscripted '4'


Write programs for String Reversal Palindrome check?

#include <stdio.h> #include <conio.h> #include <string.h> int main() { char s[50] revs[50]; int i=0 j=0; printf("Enter the string to be reversed : \n"); scanf("%s",&s); for(i=strlen(s)-1;i>=0;i--) { revs[j]=s[i]; j++; } revs[j]=' '; printf("Input String : %s\n",s); printf("Output String : %s\n" revs); getch(); }


How do you write a algebraic expression for twice as long as the length of the string?

You can write 2X, where X is the length of the string.


How do you write a function called mystrlen that receives a pointer to a character string so that the function return the length of the string?

int mystrlen (const char *s) { const char *t; if (!s) return 0; for (t=s-1;*++t;); return t-s; }