what are the data types explain with its examples | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what are the data types explain with its examples

//Java Program to illustrate how to define a class and fields //Defining a Student class. class Student{ //defining fields int id;//field or data member or instance variable String name; //creating main method inside the Student class public static void main(String args[]){ //Creating an object or instance Student s1=new Student();//creating an object of Student //Printing values of the object System.out.println(s1.id);//accessing member through reference variable System.out.println(s1.name); } }

2nd Mar 2024, 8:12 AM
Ambadas Wagh
Ambadas Wagh - avatar
1 Answer
+ 3
Welcome to Sololearn. You can learn about Java types in the beginner course. https://www.sololearn.com/learn/courses/java-introduction
2nd Mar 2024, 9:00 AM
Tibor Santa
Tibor Santa - avatar