ExamVeda
Login
Home
Data Types and Variables
?

What would be the output of the following fraction of code?
int Integer = 34 ;
char String = 'S' ;
System.out.print( Integer ) ;
System.out.print( String ) ;

Answer & Solution
Correct Answer: Option E
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

12 Comments
Chetan Dandekar
Chetan Dandekar 2 years ago
However, Java does allow this because variable names are case-sensitive.
Krishna Sankarasetti
Krishna Sankarasetti 4 years ago
Got this error after running this program:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from String to char
Shashikant Jagtap
Shashikant Jagtap 6 years ago
Both integer and String are inbuilt classes. So we can't use variable of that name.
Nikhil Rj
Nikhil Rj 8 years ago
Predefined class can be used as identifier.
Gayatri Budha
Gayatri Budha 9 years ago
How can a class Integer and String be used in variable?
Julakanti Sai
Julakanti Sai 9 years ago
if S is capital in the name string of char type wat would be the answer
Madugula Nagendra
Madugula Nagendra 9 years ago
here string represented as single quote

String s='s';
Sonu Shaw
Sonu Shaw 9 years ago
String is a reference type in java so we can use it as identifiers.
Sachin Dandge
Sachin Dandge 9 years ago
predefined java classes and interfaces can be used as an identifiers but its not a good programming practice.
Dipti Chavan
Dipti Chavan 9 years ago
what is the ouptut of following programm fragment?justify.
byte b=50;
b=b*50;
Mahendra Pirtani
Mahendra Pirtani 10 years ago
here Integer and String are Defined classes in java so how can we use this as a Identifier
Tushar Zagade
Tushar Zagade 10 years ago
String and Integer are not reserved words so no need to worry